blob: 515d3167627c4adce3be6b535803a2f18a527efc [file] [log] [blame]
Alexey Bataev70d2e542019-10-08 17:47:52 +00001// RUN: %clang_cc1 -verify -fopenmp -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s
Alexey Bataevbf5d4292019-09-17 17:36:49 +00002
Alexey Bataev70d2e542019-10-08 17:47:52 +00003// RUN: %clang_cc1 -verify -fopenmp-simd -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s
Alexey Bataevbf5d4292019-09-17 17:36:49 +00004
5// expected-no-diagnostics
6
7int foo(void);
8
Alexey Bataev0736f7f2019-09-18 16:24:31 +00009#pragma omp declare variant(foo) match(xxx={}, yyy={ccc})
Alexey Bataevbf5d4292019-09-17 17:36:49 +000010#pragma omp declare variant(foo) match(xxx={vvv})
Johannes Doerfert1228d422019-12-19 20:42:12 -060011#pragma omp declare variant(foo) match(implementation={vendor(score(0):llvm)}, device={kind(fpga)})
Alexey Bataev70d2e542019-10-08 17:47:52 +000012#pragma omp declare variant(foo) match(implementation={vendor(llvm), xxx})
Alexey Bataev4e8231b2019-11-05 15:13:30 -050013#pragma omp declare variant(foo) match(implementation={vendor(unknown)}, device={kind(gpu)})
14#pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm, xxx, ibm)}, device={kind(cpu, nohost)})
15#pragma omp declare variant(foo) match(device={kind(host)})
16#pragma omp declare variant(foo) match(device={kind(nohost), xxx})
Alexey Bataevbf5d4292019-09-17 17:36:49 +000017int bar(void);
18
19// CHECK: int foo();
Alexey Bataev4e8231b2019-11-05 15:13:30 -050020// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(nohost)})
21// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(host)})
Johannes Doerfert1228d422019-12-19 20:42:12 -060022// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm)}, device={kind(cpu, nohost)})
23// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(unknown)}, device={kind(gpu)})
24// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(llvm)})
25// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(0): llvm)}, device={kind(fpga)})
Alexey Bataevbf5d4292019-09-17 17:36:49 +000026// CHECK-NEXT: int bar();