summaryrefslogtreecommitdiffstats
path: root/test/SemaCUDA/asm-constraints-mixed.cu
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCUDA/asm-constraints-mixed.cu')
-rw-r--r--test/SemaCUDA/asm-constraints-mixed.cu15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCUDA/asm-constraints-mixed.cu b/test/SemaCUDA/asm-constraints-mixed.cu
new file mode 100644
index 0000000..a4ac9c6
--- /dev/null
+++ b/test/SemaCUDA/asm-constraints-mixed.cu
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple nvptx-unknown-cuda -fsyntax-only -fcuda-is-device -verify %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+__attribute__((device)) void df() {
+ short h;
+ // asm with PTX constraints. Some of them are PTX-specific.
+ __asm__("dont care" : "=h"(h): "f"(0.0), "d"(0.0), "h"(0), "r"(0), "l"(0));
+}
+
+void hf() {
+ int a;
+ // Asm with x86 constraints that are not supported by PTX.
+ __asm__("dont care" : "=a"(a): "a"(0), "b"(0), "c"(0));
+}
OpenPOWER on IntegriCloud