summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
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
commit6362803cfed99bc008b12b488d2c2a682df0cc2d (patch)
treef476f5ae436635f48d58742bdf2d66f0311b3488 /clang/test/CodeGen
parent41960467142142e8b2eef91436b1345a372e5d14 (diff)
downloadbcm5719-llvm-6362803cfed99bc008b12b488d2c2a682df0cc2d.tar.gz
bcm5719-llvm-6362803cfed99bc008b12b488d2c2a682df0cc2d.zip
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). llvm-svn: 159206
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/blocks.c2
-rw-r--r--clang/test/CodeGen/blocksignature.c2
-rw-r--r--clang/test/CodeGen/blockwithlocalstatic.c6
-rw-r--r--clang/test/CodeGen/capture-complex-expr-in-block.c2
-rw-r--r--clang/test/CodeGen/func-in-block.c4
5 files changed, 8 insertions, 8 deletions
diff --git a/clang/test/CodeGen/blocks.c b/clang/test/CodeGen/blocks.c
index 40bab5f63d2..71f7171c718 100644
--- a/clang/test/CodeGen/blocks.c
+++ b/clang/test/CodeGen/blocks.c
@@ -12,7 +12,7 @@ struct s0 {
int a[64];
};
-// CHECK: define internal void @__f2_block_invoke_0(%struct.s0* noalias sret {{%.*}}, i8* {{%.*}}, %struct.s0* byval align 4 {{.*}})
+// CHECK: define internal void @__f2_block_invoke(%struct.s0* noalias sret {{%.*}}, i8* {{%.*}}, %struct.s0* byval align 4 {{.*}})
struct s0 f2(struct s0 a0) {
return ^(struct s0 a1){ return a1; }(a0);
}
diff --git a/clang/test/CodeGen/blocksignature.c b/clang/test/CodeGen/blocksignature.c
index 63fe1248a86..fd586eb1e13 100644
--- a/clang/test/CodeGen/blocksignature.c
+++ b/clang/test/CodeGen/blocksignature.c
@@ -8,7 +8,7 @@
// X32: [[STR1:@.*]] = private unnamed_addr constant [6 x i8] c"v4@?0\00"
// X32: @__block_descriptor_tmp = internal constant [[FULL_DESCRIPTOR_T:.*]] { i32 0, i32 20, i8* getelementptr inbounds ([6 x i8]* [[STR1]], i32 0, i32 0), i8* null }
-// X32: @__block_literal_global = internal constant [[GLOBAL_LITERAL_T:.*]] { i8** @_NSConcreteGlobalBlock, i32 1342177280, i32 0, i8* bitcast (void (i8*)* @__block_global_{{.*}} to i8*), [[DESCRIPTOR_T:%.*]]* bitcast ([[FULL_DESCRIPTOR_T]]* @__block_descriptor_tmp to {{%.*}}*) }
+// X32: @__block_literal_global = internal constant [[GLOBAL_LITERAL_T:.*]] { i8** @_NSConcreteGlobalBlock, i32 1342177280, i32 0, i8* bitcast (void (i8*)* @global_block_invoke{{.*}} to i8*), [[DESCRIPTOR_T:%.*]]* bitcast ([[FULL_DESCRIPTOR_T]]* @__block_descriptor_tmp to {{%.*}}*) }
// X32: [[STR2:@.*]] = private unnamed_addr constant [11 x i8] c"i12@?0c4f8\00"
// X32: @__block_descriptor_tmp{{.*}} = internal constant [[FULL_DESCRIPTOR_T]] { i32 0, i32 24, i8* getelementptr inbounds ([11 x i8]* [[STR2]], i32 0, i32 0), i8* null }
// X32: store i32 1073741824, i32*
diff --git a/clang/test/CodeGen/blockwithlocalstatic.c b/clang/test/CodeGen/blockwithlocalstatic.c
index 1fdaaf37a1b..8b4210ed190 100644
--- a/clang/test/CodeGen/blockwithlocalstatic.c
+++ b/clang/test/CodeGen/blockwithlocalstatic.c
@@ -1,17 +1,17 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-llvm -o - %s | FileCheck %s
// pr8707
-// CHECK: @__block_global_0.test = internal global i32
+// CHECK: @block_block_invoke.test = internal global i32
int (^block)(void) = ^ {
static int test=0;
return test;
};
-// CHECK: @__block_global_1.test = internal global i32
+// CHECK: @block1_block_invoke_2.test = internal global i32
void (^block1)(void) = ^ {
static int test = 2;
return;
};
-// CHECK: @__block_global_2.test = internal global i32
+// CHECK: @block2_block_invoke_3.test = internal global i32
int (^block2)(void) = ^ {
static int test = 5;
return test;
diff --git a/clang/test/CodeGen/capture-complex-expr-in-block.c b/clang/test/CodeGen/capture-complex-expr-in-block.c
index 9ce7570a448..86c93d0252b 100644
--- a/clang/test/CodeGen/capture-complex-expr-in-block.c
+++ b/clang/test/CodeGen/capture-complex-expr-in-block.c
@@ -12,7 +12,7 @@ int main ()
b();
}
-// CHECK: define internal void @__main_block_invoke_0
+// CHECK: define internal void @__main_block_invoke
// CHECK: [[C1:%.*]] = alloca { double, double }, align 8
// CHECK: [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0
// CHECK-NEXT: [[R:%.*]] = load double* [[RP]]
diff --git a/clang/test/CodeGen/func-in-block.c b/clang/test/CodeGen/func-in-block.c
index 19001357d51..503695f8c37 100644
--- a/clang/test/CodeGen/func-in-block.c
+++ b/clang/test/CodeGen/func-in-block.c
@@ -15,5 +15,5 @@ int main()
return 0; // not reached
}
-// CHECK: @__func__.__main_block_invoke_0 = private unnamed_addr constant [22 x i8] c"__main_block_invoke_0\00"
-// CHECK: call void @PRINTF({{.*}}@__func__.__main_block_invoke_
+// CHECK: @__func__.__main_block_invoke = private unnamed_addr constant [20 x i8] c"__main_block_invoke\00"
+// CHECK: call void @PRINTF({{.*}}@__func__.__main_block_invoke
OpenPOWER on IntegriCloud