aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/mangle-blocks.mm
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-06-26 16:06:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-06-26 16:06:38 +0000
commit4904bf4e84cfb48080270ebaa9005327f18ab0e5 (patch)
tree2887e79ad5a24c8ba5fa803cc98ac9ebb12a5c87 /test/CodeGenObjCXX/mangle-blocks.mm
parentb9d2b3b8edf7a0dc56e55acb1cf87338d5648daa (diff)
block literal irgen: several improvements on naming block
literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjCXX/mangle-blocks.mm')
-rw-r--r--test/CodeGenObjCXX/mangle-blocks.mm16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/CodeGenObjCXX/mangle-blocks.mm b/test/CodeGenObjCXX/mangle-blocks.mm
index 22ca223d8e..892c8afede 100644
--- a/test/CodeGenObjCXX/mangle-blocks.mm
+++ b/test/CodeGenObjCXX/mangle-blocks.mm
@@ -1,19 +1,19 @@
// RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck %s
-// CHECK: @_ZGVN3foo20__foo_block_invoke_05valueE = internal global i64 0
+// CHECK: @_ZGVN3foo22___Z3foov_block_invoke5valueE = internal global i64 0
int f();
void foo() {
- // CHECK: define internal i32 @__foo_block_invoke_0
- // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVN3foo20__foo_block_invoke_05value
+ // CHECK: define internal i32 @___Z3foov_block_invoke
+ // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVN3foo22___Z3foov_block_invoke5valueE
(void)^(int x) {
static int value = f();
return x + value;
};
}
-// CHECK: define internal i32 @__block_global_0
+// CHECK: define internal i32 @i_block_invoke
int i = ^(int x) { return x;}(i);
@interface A
@@ -22,9 +22,9 @@ int i = ^(int x) { return x;}(i);
@implementation A
- (void)method {
- // CHECK: define internal signext i8 @"__11-[A method]_block_invoke_0"
+ // CHECK: define internal signext i8 @"__11-[A method]_block_invoke"
(void)^(int x) {
- // CHECK: @"_ZN11-[A method]30__11-[A method]_block_invoke_04nameE"
+ // CHECK: @"_ZN11-[A method]28__11-[A method]_block_invoke4nameE"
static const char *name = "hello";
return name[x];
};
@@ -39,10 +39,10 @@ void foo(int) {
}
namespace N {
- // CHECK: define internal signext i8 @__bar_block_invoke_0
+ // CHECK: define internal signext i8 @___Z3fooi_block_invoke
void bar() {
(void)^(int x) {
- // CHECK: @_ZN1N3bar20__bar_block_invoke_04nameE
+ // CHECK: @_ZN1N3bar26___ZN1N3barEv_block_invoke4nameE
static const char *name = "hello";
return name[x];
};