File: begin_declare_variant_using_messages.cpp

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (61 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify %s

namespace BEFORE_AND_1 {
void before_and_1();
}
namespace AFTER_AND_2 {
void after_and_2(); // expected-note {{'AFTER_AND_2::after_and_2' declared here}} expected-note {{'AFTER_AND_2::after_and_2' declared here}}
}
namespace ONLY_1 {
void only_1(); // expected-note {{'ONLY_1::only_1' declared here}}
}
namespace BEFORE_1_AND_2 {
void before_1_and_2();
}

using BEFORE_1_AND_2::before_1_and_2;
using BEFORE_AND_1::before_and_1;

void test_before() {
  before_and_1();
  after_and_2(); // expected-error {{use of undeclared identifier 'after_and_2'; did you mean 'AFTER_AND_2::after_and_2'?}}
  only_1(); // expected-error {{use of undeclared identifier 'only_1'; did you mean 'ONLY_1::only_1'?}}
  before_1_and_2();
}

#pragma omp begin declare variant match(implementation = {vendor(llvm)})
using BEFORE_1_AND_2::before_1_and_2;
using BEFORE_AND_1::before_and_1;
using ONLY_1::only_1;
void test_1() {
  before_and_1();
  after_and_2(); // expected-error {{use of undeclared identifier 'after_and_2'; did you mean 'AFTER_AND_2::after_and_2'?}}
  only_1();
  before_1_and_2();
}
#pragma omp end declare variant

#pragma omp begin declare variant match(implementation = {vendor(llvm)})
using AFTER_AND_2::after_and_2;
using BEFORE_1_AND_2::before_1_and_2;
void test_2() {
  before_and_1();
  after_and_2();
  only_1();
  before_1_and_2();
}
#pragma omp end declare variant

void test_after() {
  before_and_1();
  after_and_2();
  only_1();
  before_1_and_2();
}

using AFTER_AND_2::after_and_2;

// Make sure:
//  - we do not see the ast nodes for the gpu kind
//  - we do not choke on the text in the kind(fpga) guarded scopes
//  - we pick the right cbefore_1_and_2ees