brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 174eea4 Raw
62 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify %s2 3namespace BEFORE_AND_1 {4void before_and_1();5}6namespace AFTER_AND_2 {7void after_and_2(); // expected-note {{'AFTER_AND_2::after_and_2' declared here}} expected-note {{'AFTER_AND_2::after_and_2' declared here}}8}9namespace ONLY_1 {10void only_1(); // expected-note {{'ONLY_1::only_1' declared here}}11}12namespace BEFORE_1_AND_2 {13void before_1_and_2();14}15 16using BEFORE_1_AND_2::before_1_and_2;17using BEFORE_AND_1::before_and_1;18 19void test_before() {20  before_and_1();21  after_and_2(); // expected-error {{use of undeclared identifier 'after_and_2'; did you mean 'AFTER_AND_2::after_and_2'?}}22  only_1(); // expected-error {{use of undeclared identifier 'only_1'; did you mean 'ONLY_1::only_1'?}}23  before_1_and_2();24}25 26#pragma omp begin declare variant match(implementation = {vendor(llvm)})27using BEFORE_1_AND_2::before_1_and_2;28using BEFORE_AND_1::before_and_1;29using ONLY_1::only_1;30void test_1() {31  before_and_1();32  after_and_2(); // expected-error {{use of undeclared identifier 'after_and_2'; did you mean 'AFTER_AND_2::after_and_2'?}}33  only_1();34  before_1_and_2();35}36#pragma omp end declare variant37 38#pragma omp begin declare variant match(implementation = {vendor(llvm)})39using AFTER_AND_2::after_and_2;40using BEFORE_1_AND_2::before_1_and_2;41void test_2() {42  before_and_1();43  after_and_2();44  only_1();45  before_1_and_2();46}47#pragma omp end declare variant48 49void test_after() {50  before_and_1();51  after_and_2();52  only_1();53  before_1_and_2();54}55 56using AFTER_AND_2::after_and_2;57 58// Make sure:59//  - we do not see the ast nodes for the gpu kind60//  - we do not choke on the text in the kind(fpga) guarded scopes61//  - we pick the right cbefore_1_and_2ees62