| 1 |
// RUN: %clang_cc1 -verify -fopenmp -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s |
| 2 |
|
| 3 |
// RUN: %clang_cc1 -verify -fopenmp-simd -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s |
| 4 |
|
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
int foo(void); |
| 8 |
|
| 9 |
#pragma omp declare variant(foo) match(construct={target}) |
| 10 |
#pragma omp declare variant(foo) match(construct={teams}) |
| 11 |
#pragma omp declare variant(foo) match(construct={parallel}) |
| 12 |
#pragma omp declare variant(foo) match(construct={for}) |
| 13 |
#pragma omp declare variant(foo) match(construct={simd}) |
| 14 |
#pragma omp declare variant(foo) match(construct={target,teams,parallel,for,simd}) |
| 15 |
#pragma omp declare variant(foo) match(xxx={}, yyy={ccc}) |
| 16 |
#pragma omp declare variant(foo) match(xxx={vvv}) |
| 17 |
#pragma omp declare variant(foo) match(implementation={vendor(score(0):llvm)}, device={kind(fpga)}) |
| 18 |
#pragma omp declare variant(foo) match(implementation={vendor(llvm), xxx}) |
| 19 |
#pragma omp declare variant(foo) match(implementation={vendor(unknown)}, device={kind(gpu)}) |
| 20 |
#pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm, xxx, ibm)}, device={kind(cpu, nohost)}) |
| 21 |
#pragma omp declare variant(foo) match(device={kind(host)}) |
| 22 |
#pragma omp declare variant(foo) match(device={kind(nohost), xxx}) |
| 23 |
#pragma omp declare variant(foo) match(target_device={kind(host)}) |
| 24 |
#pragma omp declare variant(foo) match(target_device={kind(nohost), xxx}) |
| 25 |
#pragma omp declare variant(foo) match(implementation={extension(match_all)}) |
| 26 |
#pragma omp declare variant(foo) match(implementation={extension(match_any)}) |
| 27 |
#pragma omp declare variant(foo) match(implementation={extension(match_none)}) |
| 28 |
int bar(void); |
| 29 |
|
| 30 |
// CHECK: int foo(void); |
| 31 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={extension(match_none)}) |
| 32 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={extension(match_any)}) |
| 33 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={extension(match_all)}) |
| 34 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(target_device={kind(nohost)}) |
| 35 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(target_device={kind(host)}) |
| 36 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(nohost)}) |
| 37 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(host)}) |
| 38 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm)}, device={kind(cpu, nohost)}) |
| 39 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(unknown)}, device={kind(gpu)}) |
| 40 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(llvm)}) |
| 41 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(0): llvm)}, device={kind(fpga)}) |
| 42 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={target, teams, parallel, for, simd}) |
| 43 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={simd}) |
| 44 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={for}) |
| 45 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={parallel}) |
| 46 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={teams}) |
| 47 |
// CHECK-NEXT: #pragma omp declare variant(foo) match(construct={target}) |
| 48 |
// CHECK-NEXT: int bar(void); |