Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / declare_variant.cpp
blob86d0b5c7d81a19fcc3484580315accf398093c17
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify %s
3 namespace {
4 // TODO this must be fixed. This warning shouldn't be generated.
5 // expected-warning@+1{{function '(anonymous namespace)::bar' has internal linkage but is not defined}}
6 void bar();
7 } // namespace
9 #pragma omp begin declare variant match(user = {condition(1)})
10 void bar() {
12 #pragma omp end declare variant
14 // expected-warning@+1{{function 'baz' has internal linkage but is not defined}}
15 static void baz();
16 #pragma omp begin declare variant match(device = {kind(nohost)})
17 static void baz() {}
18 #pragma omp end declare variant
20 #pragma omp begin declare variant match(device = {kind(host)})
21 static void foo() {}
22 #pragma omp end declare variant
24 int main() {
25 foo();
26 // expected-note@+1{{used here}}
27 baz();
28 // expected-note@+1{{used here}}
29 bar();
31 return 0;