diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2018-06-25 15:32:05 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-06-25 15:32:05 +0000 |
| commit | 96edb2e37e7614be21e52504c1246c96b6e5f65d (patch) | |
| tree | ad07ce9dde9648460085dedc03c9141b041f0551 /clang/test | |
| parent | 32287ad897690ad37bed7a13a16174587ae29a16 (diff) | |
| download | bcm5719-llvm-96edb2e37e7614be21e52504c1246c96b6e5f65d.tar.gz bcm5719-llvm-96edb2e37e7614be21e52504c1246c96b6e5f65d.zip | |
[OPENMP] Do not consider address constant vars as possibly
threadprivate.
Do not delay emission of the address constant variables in OpenMP mode
as they cannot be defined as threadprivate.
llvm-svn: 335483
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/OpenMP/constexpr_codegen.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/OpenMP/constexpr_codegen.cpp b/clang/test/OpenMP/constexpr_codegen.cpp new file mode 100644 index 00000000000..f1fa4ac2a9e --- /dev/null +++ b/clang/test/OpenMP/constexpr_codegen.cpp @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -triple x86_64-unknown-unknown -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s +// 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 + +// 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 +// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s +// 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 +// SIMD-ONLY1-NOT: {{__kmpc|__tgt}} + +// expected-no-diagnostics +// +#ifndef HEADER +#define HEADER + +// CHECK: @{{.*}}Foo{{.*}}bar{{.*}} = constant i32 1, + +// Section A - Define a class with a static constexpr data member. +struct Foo { + static constexpr int bar = 1; +}; + +// Section B - ODR-use the data member. +void F(const int &); +void Test() { F(Foo::bar); } + +// Section C - Define the data member. +constexpr int Foo::bar; +#endif + |

