[cfe-commits] r104618 - in /cfe/trunk/test: CodeGen/blocks.c CodeGenObjC/blocks.m CodeGenObjCXX/mangle-blocks.mm
Douglas Gregor
dgregor at apple.com
Tue May 25 10:46:21 PDT 2010
Author: dgregor
Date: Tue May 25 12:46:21 2010
New Revision: 104618
URL: http://llvm.org/viewvc/llvm-project?rev=104618&view=rev
Log:
Fix testsuite for blocks mangling change
Added:
cfe/trunk/test/CodeGenObjCXX/mangle-blocks.mm
Modified:
cfe/trunk/test/CodeGen/blocks.c
cfe/trunk/test/CodeGenObjC/blocks.m
Modified: cfe/trunk/test/CodeGen/blocks.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks.c?rev=104618&r1=104617&r2=104618&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks.c (original)
+++ cfe/trunk/test/CodeGen/blocks.c Tue May 25 12:46:21 2010
@@ -12,7 +12,7 @@
int a[64];
};
-// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* sret .*, .*, .* byval .*)' %t
+// RUN: grep 'internal void @__f2_block_invoke_0(.struct.s0\* sret .*, .*, .* byval .*)' %t
struct s0 f2(struct s0 a0) {
return ^(struct s0 a1){ return a1; }(a0);
}
Modified: cfe/trunk/test/CodeGenObjC/blocks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/blocks.m?rev=104618&r1=104617&r2=104618&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/blocks.m (original)
+++ cfe/trunk/test/CodeGenObjC/blocks.m Tue May 25 12:46:21 2010
@@ -19,7 +19,7 @@
-(void) im0;
@end
-// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t
+// RUN: grep 'define internal i32 @"__8-\[A im0\]_block_invoke_0"' %t
@implementation A
-(void) im0 {
(void) ^{ return 1; }();
Added: cfe/trunk/test/CodeGenObjCXX/mangle-blocks.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/mangle-blocks.mm?rev=104618&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/mangle-blocks.mm (added)
+++ cfe/trunk/test/CodeGenObjCXX/mangle-blocks.mm Tue May 25 12:46:21 2010
@@ -0,0 +1,50 @@
+// RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
+
+// CHECK: @_ZGVN3foo20__foo_block_invoke_05valueE = 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
+ (void)^(int x) {
+ static int value = f();
+ return x + value;
+ };
+}
+
+// CHECK: define internal i32 @__block_global_0
+int i = ^(int x) { return x;}(i);
+
+ at interface A
+- (void)method;
+ at end
+
+ at implementation A
+- (void)method {
+ // CHECK: define internal signext i8 @"__11-[A method]_block_invoke_0"
+ (void)^(int x) {
+ // CHECK: @"_ZN11-[A method]30__11-[A method]_block_invoke_04nameE"
+ static const char *name = "hello";
+ return name[x];
+ };
+}
+ at end
+
+void foo(int) {
+ (void)^(int x) {
+ static const char *name = "hello";
+ return name[x];
+ };
+}
+
+namespace N {
+ // CHECK: define internal signext i8 @__bar_block_invoke_0
+ void bar() {
+ (void)^(int x) {
+ // CHECK: @_ZN1N3bar20__bar_block_invoke_04nameE
+ static const char *name = "hello";
+ return name[x];
+ };
+ }
+}
More information about the cfe-commits
mailing list