diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-05-25 17:46:21 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-05-25 17:46:21 +0000 |
| commit | aab11ede6e2f2969d9f18e17cb0b4f98a08047b7 (patch) | |
| tree | 01ab59fa6493623018123e629ff5cc8c49850097 /clang | |
| parent | f6562d35ac4741be84308bd217cc8d3e14037a8d (diff) | |
| download | bcm5719-llvm-aab11ede6e2f2969d9f18e17cb0b4f98a08047b7.tar.gz bcm5719-llvm-aab11ede6e2f2969d9f18e17cb0b4f98a08047b7.zip | |
Fix testsuite for blocks mangling change
llvm-svn: 104618
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/test/CodeGen/blocks.c | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/blocks.m | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenObjCXX/mangle-blocks.mm | 50 |
3 files changed, 52 insertions, 2 deletions
diff --git a/clang/test/CodeGen/blocks.c b/clang/test/CodeGen/blocks.c index e7625b19542..a0f5dae6f44 100644 --- a/clang/test/CodeGen/blocks.c +++ b/clang/test/CodeGen/blocks.c @@ -12,7 +12,7 @@ struct s0 { 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); } diff --git a/clang/test/CodeGenObjC/blocks.m b/clang/test/CodeGenObjC/blocks.m index 75b81062f0e..b96a8d942fa 100644 --- a/clang/test/CodeGenObjC/blocks.m +++ b/clang/test/CodeGenObjC/blocks.m @@ -19,7 +19,7 @@ void foo(T *P) { -(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; }(); diff --git a/clang/test/CodeGenObjCXX/mangle-blocks.mm b/clang/test/CodeGenObjCXX/mangle-blocks.mm new file mode 100644 index 00000000000..9f57557f8f6 --- /dev/null +++ b/clang/test/CodeGenObjCXX/mangle-blocks.mm @@ -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); + +@interface A +- (void)method; +@end + +@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]; + }; +} +@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]; + }; + } +} |

