diff options
Diffstat (limited to 'test/CodeGenObjC/arc-linetable.m')
-rw-r--r-- | test/CodeGenObjC/arc-linetable.m | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/CodeGenObjC/arc-linetable.m b/test/CodeGenObjC/arc-linetable.m index eac91f188907c..2d56ab3dfb55d 100644 --- a/test/CodeGenObjC/arc-linetable.m +++ b/test/CodeGenObjC/arc-linetable.m @@ -32,6 +32,13 @@ // CHECK: @objc_msgSend{{.*}} !dbg ![[MSG7:[0-9]+]] // CHECK: ret {{.*}} !dbg ![[RET7:[0-9]+]] +// CHECK: define {{.*}}testCleanupVoid +// CHECK: icmp ne {{.*}}!dbg ![[SKIP1:[0-9]+]] +// CHECK: store i32 0, i32* {{.*}}, !dbg ![[RET8:[0-9]+]] +// CHECK: @objc_storeStrong{{.*}}, !dbg ![[ARC8:[0-9]+]] +// CHECK: ret {{.*}} !dbg ![[RET8]] + +typedef signed char BOOL; @interface NSObject + (id)alloc; @@ -47,8 +54,10 @@ @implementation AppDelegate : NSObject +// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]] - (int)testNoSideEffect:(NSString *)foo { - // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null} + int x = 1; + // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata ![[TESTNOSIDEEFFECT]], null} return 1; // Return expression // CHECK: ![[RET1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null} } // Cleanup + Ret @@ -91,6 +100,22 @@ return 1; } +- (void)testCleanupVoid:(BOOL)skip withDelegate: (AppDelegate *) delegate { + static BOOL skip_all; + // CHECK: ![[SKIP1]] = metadata !{i32 [[@LINE+1]], i32 0, + if (!skip_all) { + if (!skip) { + return; + } + NSString *s = @"bar"; + if (!skip) { + [delegate testVoid :s]; + } + } + // CHECK: ![[RET8]] = metadata !{i32 [[@LINE+2]], i32 0, + // CHECK: ![[ARC8]] = metadata !{i32 [[@LINE+1]], i32 0, +} + @end |