================
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -isystem %S/Inputs -verify %s
+// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \
+// RUN: -isystem %S/Inputs -fcuda-is-device -verify %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -isystem %S/Inputs -verify=redecl -Woffload-incompatible-redeclare %s
+// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \
+// RUN: -isystem %S/Inputs -fcuda-is-device -Woffload-incompatible-redeclare
-verify=redecl %s
+
+// expected-no-diagnostics
+#include "cuda.h"
+
+__device__ void f(); // redecl-note {{previous declaration is here}}
+
+void f() {} // redecl-warning {{incompatible host/device attribute with
redeclaration: new declaration is __host__ function, old declaration is
__device__ function. It will cause warning with nvcc}}
----------------
philnik777 wrote:
IMO that looks like a nice "this is incompatible with X" warning like we have
for GCC, different C/C++ versions etc., but I'm not an expert here, so maybe
this isn't actually an incompatibility? FWIW neither the diagnostic nor you
comment make this really clear to me. (Also I'd drop the `It will cause warning
with nvcc` and make the flag something like `-Wnvcc-compat`)
https://github.com/llvm/llvm-project/pull/77359
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits