================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers
-include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include
-x c++ -fopenmp -triple amdgpu-amd-amdhsa -aux-triple x86_64-unknown-unknown
-fopenmp-targets=amdgpu-amd-amdhsa -fopenmp-is-target-device -fsyntax-only
-verify %s
+
+// The OpenMP math wrapper pulls in __clang_hip_math.h, whose ::min and ::max
+// are a CUDA compatibility extension for HIP. In an OpenMP translation unit
+// these calls are ordinary unqualified C++ lookups and must resolve to std.
+
+// expected-no-diagnostics
+
+#include <algorithm>
+#include <cmath>
+
+using namespace std;
+
+long test_min(long __a, long __b) { return min(__a, __b); }
----------------
lfmeadow wrote:
Moved it into `amdgcn_openmp_device_math.c`, which already has a C++ RUN line
against the same wrappers. It's two C++-only functions with regenerated checks,
and those now show the calls resolving to `std::min<long>` and
`std::max<long>`. Without the header change they still fail as ambiguous.
https://github.com/llvm/llvm-project/pull/225162
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits