summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/target_map_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-10-14 12:43:59 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-10-14 12:43:59 +0000
commit9c7db0323d4e9cbf391b8d738a5b2c5094e89d9f (patch)
tree146e379c661f647cf029e4c52d30b7a70e1b8a33 /test/OpenMP/target_map_codegen.cpp
parent8ed284f8ed0138d434153aa9bd20401081b8c599 (diff)
Fix for PR30632: Name mangling issue.
There was a bug in the implementation of captured statements. If it has a lambda expression in it and the same lambda expression is used outside the captured region, clang produced an error: ``` error: definition with same mangled name as another definition ``` Here is an example: ``` struct A { template <typename L> void g(const L&) { } }; template<typename T> void f() { { A().g([](){}); } A().g([](){}); } int main() { f<void>(); } ``` Error report: ``` main.cpp:3:10: error: definition with same mangled name as another definition void g(const L&) { } ^ main.cpp:3:10: note: previous definition is here ``` Patch fixes this bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/target_map_codegen.cpp')
-rw-r--r--test/OpenMP/target_map_codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/OpenMP/target_map_codegen.cpp b/test/OpenMP/target_map_codegen.cpp
index 92ed0abf94..72c7257a0e 100644
--- a/test/OpenMP/target_map_codegen.cpp
+++ b/test/OpenMP/target_map_codegen.cpp
@@ -4104,7 +4104,9 @@ int explicit_maps_with_inner_lambda(int a){
// CK25: [[VAL1:%.+]] = load i32*, i32** [[VALADDR]],
// CK25: [[VALADDR1:%.+]] = getelementptr inbounds [[CA01]], [[CA01]]* [[CA:%[^,]+]], i32 0, i32 0
// CK25: store i32* [[VAL1]], i32** [[VALADDR1]],
-// CK25: call void {{.*}}[[LAMBDA]]{{.*}}([[CA01]]* [[CA]])
+// CK25: call void {{.*}}[[LAMBDA2:@.+]]{{.*}}([[CA01]]* [[CA]])
+
+// CK25: define {{.+}}[[LAMBDA2]]
#endif
///==========================================================================///
// RUN: %clang_cc1 -DCK26 -std=c++11 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK26 --check-prefix CK26-64