aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCUDA/alias.cu
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCUDA/alias.cu')
-rw-r--r--test/SemaCUDA/alias.cu11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCUDA/alias.cu b/test/SemaCUDA/alias.cu
new file mode 100644
index 000000000000..39251ed10ecd
--- /dev/null
+++ b/test/SemaCUDA/alias.cu
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple nvptx-unknown-cuda -fsyntax-only -fcuda-is-device -verify -DEXPECT_ERR %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
+
+// The alias attribute is not allowed in CUDA device code.
+void bar();
+__attribute__((alias("bar"))) void foo();
+#ifdef EXPECT_ERR
+// expected-error@-2 {{CUDA does not support aliases}}
+#else
+// expected-no-diagnostics
+#endif