diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-06-18 20:29:06 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-06-18 20:29:06 +0000 |
| commit | 9f3a805ee96b70ebe384ea6337c49464b5f28af2 (patch) | |
| tree | 3253343863b9e09f3cd372b8e03b5c88f8e9ee50 /clang/test | |
| parent | ba43840bfe2ea9e7a528d0a99d6a4d07d376567d (diff) | |
| download | bcm5719-llvm-9f3a805ee96b70ebe384ea6337c49464b5f28af2.tar.gz bcm5719-llvm-9f3a805ee96b70ebe384ea6337c49464b5f28af2.zip | |
[OPENMP]Use host's mangling for 128 bit float types on the device.
Device have to use the same mangling as the host for 128bit float types. Otherwise, the codegen for the device is unable to find the parent function when it tries to generate the outlined function for the target region and it leads to incorrect compilation and crash at the runtime.
llvm-svn: 363734
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp b/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp index 2573daaa418..81e7df7e35a 100644 --- a/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp +++ b/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp @@ -8,13 +8,15 @@ // CHECK-DAG: [[T:%.+]] = type {{.+}}, fp128, // CHECK-DAG: [[T1:%.+]] = type {{.+}}, i128, i128, -struct T { - char a; #ifndef _ARCH_PPC - __float128 f; +typedef __float128 BIGTYPE; #else - long double f; +typedef long double BIGTYPE; #endif + +struct T { + char a; + BIGTYPE f; char c; T() : a(12), f(15) {} T &operator+(T &b) { f += b.a; return *this;} @@ -68,3 +70,12 @@ void baz1() { T1 t = bar1(); } #pragma omp end declare target + +BIGTYPE foo(BIGTYPE f) { +#pragma omp target map(f) + f = 1; + return f; +} + +// CHECK: define weak void @__omp_offloading_{{.+}}foo{{.+}}_l75([[BIGTYPE:.+]]* +// CHECK: store [[BIGTYPE]] 0xL00000000000000003FFF000000000000, [[BIGTYPE]]* % |

