1 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c -std=c99 -fms-extensions -Wno-pragma-pack %s 2 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -x c -std=c99 -fms-extensions -Wno-pragma-pack %s 3 4 #pragma omp begin declare variant match(device={kind(cpu)}) also_before(void)5int also_before(void) { 6 return 0; 7 } 8 #pragma omp end declare variant 9 10 #pragma omp begin declare variant match(device={kind(gpu)}) // expected-note {{to match this '#pragma omp begin declare variant'}} 11 // The matching end is missing. Since the device clause is not matching we will 12 // cause us to elide the rest of the file and emit and error. also_after(void)13int also_after(void) { 14 return 2; 15 } also_before(void)16int also_before(void) { 17 return 2; 18 } 19 20 21 #pragma omp begin declare variant match(device={kind(fpga)}) 22 23 This text is never parsed! 24 25 #pragma omp end declare variant 26 27 int also_after(void) { 28 return 0; 29 } 30 test()31int test() { 32 return also_after() + also_before(); 33 } // expected-error {{expected '#pragma omp end declare variant'}} 34