14e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
2*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DHOST
3*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DHOST | FileCheck %s
44e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
5*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DHOST
6*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DHOST | FileCheck %s
74e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
8*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DHOST
9*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DHOST | FileCheck %s
104e8231b5SAlexey Bataev 
114e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
12*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DCPU
13*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DCPU | FileCheck %s
144e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
15*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DCPU
16*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DCPU | FileCheck %s
174e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
18*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=45 %s -DCPU
19*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 -DCPU | FileCheck %s
20*ff260ad0SSaiyedul Islam 
21*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
22*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
23*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
24*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
25*ff260ad0SSaiyedul Islam 
26*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
27*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
28*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
29*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
30*ff260ad0SSaiyedul Islam 
31*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
32*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
33*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
34*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
35*ff260ad0SSaiyedul Islam 
36*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
37*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
38*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
39*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
40*ff260ad0SSaiyedul Islam 
41*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
42*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DHOST
43*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DHOST | FileCheck %s
44*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
45*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DHOST
46*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DHOST | FileCheck %s
47*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
48*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DHOST
49*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DHOST | FileCheck %s
50*ff260ad0SSaiyedul Islam 
51*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
52*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DCPU
53*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DCPU | FileCheck %s
54*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
55*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DCPU
56*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DCPU | FileCheck %s
57*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
58*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -DCPU
59*ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DCPU | FileCheck %s
604e8231b5SAlexey Bataev 
614e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
624e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
634e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
644e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
654e8231b5SAlexey Bataev 
664e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
674e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
684e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
694e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
704e8231b5SAlexey Bataev 
714e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
724e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
734e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
744e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
754e8231b5SAlexey Bataev 
764e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
774e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
784e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
794e8231b5SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
804e8231b5SAlexey Bataev 
814e8231b5SAlexey Bataev // expected-no-diagnostics
824e8231b5SAlexey Bataev 
83befb4be3SJohannes Doerfert // CHECK-NOT: alias
84befb4be3SJohannes Doerfert 
854e8231b5SAlexey Bataev // CHECK-NOT: ret i32 {{1|4|81|84}}
864e8231b5SAlexey Bataev // CHECK-DAG: declare {{.*}}i32 @_Z5bazzzv()
87befb4be3SJohannes Doerfert // CHECK-DAG: define {{.*}}i32 @_Z3bazv()
884e8231b5SAlexey Bataev // CHECK-DAG: ret i32 2
894e8231b5SAlexey Bataev // CHECK-DAG: ret i32 3
904e8231b5SAlexey Bataev // CHECK-DAG: ret i32 5
914e8231b5SAlexey Bataev // CHECK-DAG: ret i32 6
924e8231b5SAlexey Bataev // CHECK-DAG: ret i32 7
934e8231b5SAlexey Bataev // CHECK-DAG: ret i32 82
944e8231b5SAlexey Bataev // CHECK-DAG: ret i32 83
954e8231b5SAlexey Bataev // CHECK-DAG: ret i32 85
964e8231b5SAlexey Bataev // CHECK-DAG: ret i32 86
974e8231b5SAlexey Bataev // CHECK-DAG: ret i32 87
98befb4be3SJohannes Doerfert // CHECK-NOT: ret i32 {{4|81|84}}
994e8231b5SAlexey Bataev 
1004e8231b5SAlexey Bataev #ifndef HEADER
1014e8231b5SAlexey Bataev #define HEADER
1024e8231b5SAlexey Bataev 
1034e8231b5SAlexey Bataev #pragma omp declare target
1044e8231b5SAlexey Bataev #ifdef HOST
1051228d42dSJohannes Doerfert #define SUBSET host
1061228d42dSJohannes Doerfert #define CORRECT host, cpu
1074e8231b5SAlexey Bataev #define WRONG host, nohost
1084e8231b5SAlexey Bataev #endif // HOST
1094e8231b5SAlexey Bataev #ifdef CPU
1101228d42dSJohannes Doerfert #define SUBSET cpu
1111228d42dSJohannes Doerfert #define CORRECT cpu, any
1124e8231b5SAlexey Bataev #define WRONG cpu, gpu
1134e8231b5SAlexey Bataev #endif // CPU
1144e8231b5SAlexey Bataev #ifdef NOHOST
1151228d42dSJohannes Doerfert #define SUBSET nohost
1161228d42dSJohannes Doerfert #define CORRECT nohost, cpu
1174e8231b5SAlexey Bataev #define WRONG nohost, host
1184e8231b5SAlexey Bataev #endif // NOHOST
1194e8231b5SAlexey Bataev 
foo()1204e8231b5SAlexey Bataev int foo() { return 2; }
1214e8231b5SAlexey Bataev 
1224e8231b5SAlexey Bataev #pragma omp declare variant(foo) match(device = {kind(CORRECT)})
bar()1234e8231b5SAlexey Bataev int bar() { return 1; }
1244e8231b5SAlexey Bataev 
1254e8231b5SAlexey Bataev int bazzz();
1264e8231b5SAlexey Bataev #pragma omp declare variant(bazzz) match(device = {kind(CORRECT)})
baz()1274e8231b5SAlexey Bataev int baz() { return 1; }
1284e8231b5SAlexey Bataev 
1294e8231b5SAlexey Bataev int test();
1304e8231b5SAlexey Bataev #pragma omp declare variant(test) match(device = {kind(CORRECT)})
call()1314e8231b5SAlexey Bataev int call() { return 1; }
1324e8231b5SAlexey Bataev 
1334e8231b5SAlexey Bataev static int stat_unused_();
1344e8231b5SAlexey Bataev #pragma omp declare variant(stat_unused_) match(device = {kind(CORRECT)})
stat_unused()1354e8231b5SAlexey Bataev static int stat_unused() { return 1; }
1364e8231b5SAlexey Bataev 
1374e8231b5SAlexey Bataev static int stat_used_();
1384e8231b5SAlexey Bataev #pragma omp declare variant(stat_used_) match(device = {kind(CORRECT)})
stat_used()1394e8231b5SAlexey Bataev static int stat_used() { return 1; }
1404e8231b5SAlexey Bataev 
main()1414e8231b5SAlexey Bataev int main() { return bar() + baz() + call() + stat_used(); }
1424e8231b5SAlexey Bataev 
test()1434e8231b5SAlexey Bataev int test() { return 3; }
stat_unused_()1444e8231b5SAlexey Bataev static int stat_unused_() { return 4; }
stat_used_()1454e8231b5SAlexey Bataev static int stat_used_() { return 5; }
1464e8231b5SAlexey Bataev 
1474e8231b5SAlexey Bataev struct SpecialFuncs {
vdSpecialFuncs1484e8231b5SAlexey Bataev   void vd() {}
1494e8231b5SAlexey Bataev   SpecialFuncs();
1504e8231b5SAlexey Bataev   ~SpecialFuncs();
1514e8231b5SAlexey Bataev 
method_SpecialFuncs1524e8231b5SAlexey Bataev   int method_() { return 6; }
1534e8231b5SAlexey Bataev #pragma omp declare variant(SpecialFuncs::method_) \
1544e8231b5SAlexey Bataev     match(device = {kind(CORRECT)})
methodSpecialFuncs1554e8231b5SAlexey Bataev   int method() { return 1; }
1564e8231b5SAlexey Bataev #pragma omp declare variant(SpecialFuncs::method_) \
1574e8231b5SAlexey Bataev     match(device = {kind(CORRECT)})
1584e8231b5SAlexey Bataev   int Method();
1594e8231b5SAlexey Bataev } s;
1604e8231b5SAlexey Bataev 
Method()1614e8231b5SAlexey Bataev int SpecialFuncs::Method() { return 1; }
1624e8231b5SAlexey Bataev 
1634e8231b5SAlexey Bataev struct SpecSpecialFuncs {
vdSpecSpecialFuncs1644e8231b5SAlexey Bataev   void vd() {}
1654e8231b5SAlexey Bataev   SpecSpecialFuncs();
1664e8231b5SAlexey Bataev   ~SpecSpecialFuncs();
1674e8231b5SAlexey Bataev 
1684e8231b5SAlexey Bataev   int method_();
1694e8231b5SAlexey Bataev #pragma omp declare variant(SpecSpecialFuncs::method_) \
1704e8231b5SAlexey Bataev     match(device = {kind(CORRECT)})
methodSpecSpecialFuncs1714e8231b5SAlexey Bataev   int method() { return 1; }
1724e8231b5SAlexey Bataev #pragma omp declare variant(SpecSpecialFuncs::method_) \
1734e8231b5SAlexey Bataev     match(device = {kind(CORRECT)})
1744e8231b5SAlexey Bataev   int Method();
1754e8231b5SAlexey Bataev } s1;
1764e8231b5SAlexey Bataev 
method_()1774e8231b5SAlexey Bataev int SpecSpecialFuncs::method_() { return 7; }
Method()1784e8231b5SAlexey Bataev int SpecSpecialFuncs::Method() { return 1; }
1794e8231b5SAlexey Bataev 
xxx()1804e8231b5SAlexey Bataev void xxx() {
1814e8231b5SAlexey Bataev   (void)s.method();
1824e8231b5SAlexey Bataev   (void)s1.method();
1834e8231b5SAlexey Bataev }
1844e8231b5SAlexey Bataev 
prio()1854e8231b5SAlexey Bataev int prio() { return 81; }
prio1()1864e8231b5SAlexey Bataev int prio1() { return 82; }
1874e8231b5SAlexey Bataev 
1884e8231b5SAlexey Bataev #pragma omp declare variant(prio) match(device = {kind(SUBSET)})
1894e8231b5SAlexey Bataev #pragma omp declare variant(prio1) match(device = {kind(CORRECT)})
prio_()1904e8231b5SAlexey Bataev int prio_() { return 1; }
1914e8231b5SAlexey Bataev 
prio2()1924e8231b5SAlexey Bataev static int prio2() { return 83; }
prio3()1934e8231b5SAlexey Bataev static int prio3() { return 84; }
prio4()1944e8231b5SAlexey Bataev static int prio4() { return 84; }
1954e8231b5SAlexey Bataev 
1964e8231b5SAlexey Bataev #pragma omp declare variant(prio4) match(device = {kind(SUBSET)})
1974e8231b5SAlexey Bataev #pragma omp declare variant(prio2) match(device = {kind(CORRECT)})
1984e8231b5SAlexey Bataev #pragma omp declare variant(prio3) match(device = {kind(SUBSET)})
prio1_()1994e8231b5SAlexey Bataev static int prio1_() { return 1; }
2004e8231b5SAlexey Bataev 
int_fn()2014e8231b5SAlexey Bataev int int_fn() { return prio1_(); }
2024e8231b5SAlexey Bataev 
fn_linkage_variant()2034e8231b5SAlexey Bataev int fn_linkage_variant() { return 85; }
2044e8231b5SAlexey Bataev extern "C" {
2054e8231b5SAlexey Bataev #pragma omp declare variant(fn_linkage_variant) match(device = {kind(CORRECT)})
fn_linkage()2064e8231b5SAlexey Bataev int fn_linkage() { return 1; }
2074e8231b5SAlexey Bataev }
2084e8231b5SAlexey Bataev 
fn_linkage_variant1()2094e8231b5SAlexey Bataev extern "C" int fn_linkage_variant1() { return 86; }
2104e8231b5SAlexey Bataev #pragma omp declare variant(fn_linkage_variant1) match(device = {kind(CORRECT)})
fn_linkage1()2114e8231b5SAlexey Bataev int fn_linkage1() { return 1; }
2124e8231b5SAlexey Bataev 
fn_variant2()2134e8231b5SAlexey Bataev int fn_variant2() { return 1; }
2144e8231b5SAlexey Bataev #pragma omp declare variant(fn_variant2) match(device = {kind(WRONG)})
fn2()2154e8231b5SAlexey Bataev int fn2() { return 87; }
2164e8231b5SAlexey Bataev 
2174e8231b5SAlexey Bataev #pragma omp end declare target
2184e8231b5SAlexey Bataev #endif // HEADER
219