1 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
2 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
3 // RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -fopenmp-version=45 -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
4 // RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -fopenmp-version=45 -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
5 // RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
6 // RUN: %clang_cc1 -verify=expected,omp5 -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
7 // RUN: %clang_cc1 -verify=expected,omp5 -DDIAGS -DOMP5 -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
8 // RUN: %clang_cc1 -verify=expected,omp5 -DDIAGS -DOMP5 -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
9 // REQUIRES: x86-registered-target
10 // REQUIRES: nvptx-registered-target
13 // expected-no-diagnostics
19 // omp5-error@+4 {{invalid input constraint 'mx' in asm}}
21 __asm__("PR3908 %[lf] %[xx] %[li] %[r]"
23 : [ lf
] "mx"(0), [ li
] "mr"(0), [ xx
] "x"((double)(0)));
26 #pragma omp declare target to(bar) device_type(nohost)
28 #pragma omp declare target to(bar) device_type(host)
34 // expected-error@+4 {{invalid input constraint 'mx' in asm}}
36 __asm__("PR3908 %[lf] %[xx] %[li] %[r]"
38 : [ lf
] "mx"(0), [ li
] "mr"(0), [ xx
] "x"((double)(0)));
41 #pragma omp declare target to(foo)
45 #pragma omp declare target
49 // expected-error@+4 {{invalid input constraint 'mx' in asm}}
51 __asm__("PR3908 %[lf] %[xx] %[li] %[r]"
53 : [ lf
] "mx"(0), [ li
] "mr"(0), [ xx
] "x"((double)(0)));
56 unsigned t2(signed char input
) {
59 // expected-error@+3 {{invalid output constraint '=a' in asm}}
68 register long double result
;
70 // expected-error@+3 {{invalid output constraint '=t' in asm}}
72 __asm
__volatile("frndint"
78 unsigned char t4(unsigned char a
, unsigned char b
) {
84 // expected-error@+3 {{invalid output constraint '=la' in asm}}
87 : [ bigres
] "=la"(bigres
)
88 : [ la
] "0"(la
), [ lb
] "c"(lb
)
96 // expected-error@+6 {{unknown register name 'st' in asm}}
102 : "st", "st(1)", "st(2)", "st(3)",
103 "st(4)", "st(5)", "st(6)", "st(7)",
107 typedef long long __m256i
__attribute__((__vector_size__(32)));
108 void t6(__m256i
*p
) {
110 // expected-error@+3 {{unknown register name 'ymm0' in asm}}
112 __asm__
volatile("vmovaps %0, %%ymm0" ::"m"(*(__m256i
*)p
)
116 #pragma omp end declare target
125 // expected-note@+2 {{called by 'main'}}
129 // expected-note@+2 {{called by 'main'}}
133 // expected-note@+2 {{called by 'main'}}
137 // expected-note@+2 {{called by 'main'}}
141 // expected-note@+2 {{called by 'main'}}
145 // expected-note@+2 {{called by 'main'}}