[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / constexpr_codegen.cpp
blob67757a9a2e1597d71f22fc2962bf9384789185e0
1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -triple x86_64-unknown-unknown -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
5 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -triple x86_64-unknown-unknown -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY1 %s
6 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
8 // SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
10 // expected-no-diagnostics
12 #ifndef HEADER
13 #define HEADER
15 // CHECK: @{{.*}}Foo{{.*}}bar{{.*}} ={{.*}} constant i32 1,
17 // Section A - Define a class with a static constexpr data member.
18 struct Foo {
19 static constexpr int bar = 1;
22 // Section B - ODR-use the data member.
23 void F(const int &);
24 void Test() { F(Foo::bar); }
26 // Section C - Define the data member.
27 constexpr int Foo::bar;
28 #endif