Adrian Prantl | 7c731f5 | 2013-05-30 18:12:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -fobjc-arc -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s |
| 2 | // Ensure that the line info is making sense: |
| 3 | // ARC cleanups should be at the closing '}'. |
| 4 | @protocol NSObject |
| 5 | @end |
| 6 | |
| 7 | @interface NSObject <NSObject> {} |
| 8 | @end |
| 9 | |
| 10 | @protocol NSCopying |
| 11 | @end |
| 12 | |
| 13 | @protocol NSCoding |
| 14 | @end |
| 15 | |
| 16 | typedef double CGFloat; |
| 17 | struct CGRect {}; |
| 18 | typedef struct CGRect CGRect; |
| 19 | typedef CGRect NSRect; |
| 20 | NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h); |
| 21 | @interface NSBezierPath : NSObject <NSCopying, NSCoding> |
| 22 | + (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius; |
| 23 | @end |
| 24 | @implementation AppDelegate : NSObject {} |
| 25 | - (NSBezierPath *)_createBezierPathWithWidth:(CGFloat)width height:(CGFloat)height radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth |
| 26 | { |
| 27 | NSRect rect = NSMakeRect(0, 0, width, height); |
| 28 | NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; |
| 29 | CGFloat pattern[2]; |
| 30 | // CHECK: define {{.*}}_createBezierPathWithWidth |
| 31 | // CHECK: load {{.*}} %path, align {{.*}}, !dbg ![[RET:[0-9]+]] |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 32 | // CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]] |
| 33 | // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]] |
| 34 | // CHECK: ret {{.*}} !dbg ![[ARC]] |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 35 | // CHECK: ![[RET]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) |
Adrian Prantl | 7c731f5 | 2013-05-30 18:12:23 +0000 | [diff] [blame] | 36 | return path; |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 37 | // CHECK: ![[ARC]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) |
Adrian Prantl | 7c731f5 | 2013-05-30 18:12:23 +0000 | [diff] [blame] | 38 | } |
| 39 | @end |