diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-13 20:46:28 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-13 20:46:28 +0000 |
commit | ab41ea6282a75c3ece5cef037ced75f3f7acc724 (patch) | |
tree | 0178b23b113ba4038b9b9a51f092e6a07c612ff1 /clang/test/OpenMP/task_firstprivate_codegen.cpp | |
parent | f653e56a6773ca1ba52f45d8ea89307fe16d3868 (diff) | |
download | bcm5719-llvm-ab41ea6282a75c3ece5cef037ced75f3f7acc724.tar.gz bcm5719-llvm-ab41ea6282a75c3ece5cef037ced75f3f7acc724.zip |
[OPENMP]Fix PR37283: Assertion failure on openmp task with by reference
array.
If the firstprivate variable is a reference, we may incorrectly classify
the kind of the private copy. Use the type of the private copy instead
of the original shared variable.
llvm-svn: 356098
Diffstat (limited to 'clang/test/OpenMP/task_firstprivate_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/task_firstprivate_codegen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/OpenMP/task_firstprivate_codegen.cpp b/clang/test/OpenMP/task_firstprivate_codegen.cpp index 09b1deabde4..dc0ba8ac67a 100644 --- a/clang/test/OpenMP/task_firstprivate_codegen.cpp +++ b/clang/test/OpenMP/task_firstprivate_codegen.cpp @@ -473,12 +473,13 @@ struct St { ~St() {} }; -void array_func(int n, float a[n], St s[2]) { +void array_func(int n, float a[n], St s[2], int(& p)[1]) { // ARRAY: call i8* @__kmpc_omp_task_alloc( // ARRAY: call i32 @__kmpc_omp_task( // ARRAY: store float** %{{.+}}, float*** %{{.+}}, // ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}}, -#pragma omp task firstprivate(a, s) +// ARRAY: store [1 x i32]* %{{.+}}, [1 x i32]** %{{.+}}, +#pragma omp task firstprivate(a, s, p) ; } #endif |