77// RUN: %clang_cc1 -triple i386-apple-darwin11 -fobjc-runtime=macosx-fragile-10.11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED -check-prefix=CHECK-MARKED -check-prefix=CALL
88
99// Make sure it works on ARM64.
10- // RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED -check-prefix=CHECK-MARKED -check-prefix= CALL
10+ // RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=ATTACHED- CALL
1111
1212// Make sure it works on ARM.
1313// RUN: %clang_cc1 -triple armv7-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED -check-prefix=CHECK-MARKED -check-prefix=CALL
@@ -41,8 +41,9 @@ void test_assign(void) {
4141// DISABLED-NEXT: [[T2:%.*]] = {{.*}}call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr [[T0]])
4242
4343// ATTACHED-CALL-LABEL: define{{.*}} void @test_assign()
44- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
45- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
44+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
45+ // ATTACHED-CALL-DAG: call void asm sideeffect
46+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
4647
4748void test_assign_assign (void ) {
4849 __unsafe_unretained id x, y;
@@ -62,8 +63,9 @@ void test_assign_assign(void) {
6263// CHECK-NEXT: ret void
6364
6465// ATTACHED-CALL-LABEL: define{{.*}} void @test_assign_assign()
65- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
66- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
66+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
67+ // ATTACHED-CALL-DAG: call void asm sideeffect
68+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
6769
6870void test_strong_assign_assign (void ) {
6971 __strong id x;
@@ -88,8 +90,9 @@ void test_strong_assign_assign(void) {
8890// CHECK-NEXT: ret void
8991
9092// ATTACHED-CALL-LABEL: define{{.*}} void @test_strong_assign_assign()
91- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ],
92- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
93+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
94+ // ATTACHED-CALL-DAG: call void asm sideeffect
95+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
9396
9497void test_assign_strong_assign (void ) {
9598 __unsafe_unretained id x;
@@ -114,8 +117,9 @@ void test_assign_strong_assign(void) {
114117// CHECK-NEXT: ret void
115118
116119// ATTACHED-CALL-LABEL: define{{.*}} void @test_assign_strong_assign()
117- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ],
118- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
120+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
121+ // ATTACHED-CALL-DAG: call void asm sideeffect
122+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
119123
120124void test_init (void ) {
121125 __unsafe_unretained id x = makeA ();
@@ -131,8 +135,9 @@ void test_init(void) {
131135// CHECK-NEXT: ret void
132136
133137// ATTACHED-CALL-LABEL: define{{.*}} void @test_init()
134- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
135- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
138+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
139+ // ATTACHED-CALL-DAG: call void asm sideeffect
140+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
136141
137142void test_init_assignment (void ) {
138143 __unsafe_unretained id x;
@@ -152,8 +157,9 @@ void test_init_assignment(void) {
152157// CHECK-NEXT: ret void
153158
154159// ATTACHED-CALL-LABEL: define{{.*}} void @test_init_assignment()
155- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
156- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
160+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
161+ // ATTACHED-CALL-DAG: call void asm sideeffect
162+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
157163
158164void test_strong_init_assignment (void ) {
159165 __unsafe_unretained id x;
@@ -175,8 +181,9 @@ void test_strong_init_assignment(void) {
175181// CHECK-NEXT: ret void
176182
177183// ATTACHED-CALL-LABEL: define{{.*}} void @test_strong_init_assignment()
178- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ],
179- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
184+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
185+ // ATTACHED-CALL-DAG: call void asm sideeffect
186+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
180187
181188void test_init_strong_assignment (void ) {
182189 __strong id x;
@@ -200,8 +207,9 @@ void test_init_strong_assignment(void) {
200207// CHECK-NEXT: ret void
201208
202209// ATTACHED-CALL-LABEL: define{{.*}} void @test_init_strong_assignment()
203- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ],
204- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
210+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
211+ // ATTACHED-CALL-DAG: call void asm sideeffect
212+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
205213
206214void test_ignored (void ) {
207215 makeA ();
@@ -214,8 +222,9 @@ void test_ignored(void) {
214222// CHECK-NEXT: ret void
215223
216224// ATTACHED-CALL-LABEL: define{{.*}} void @test_ignored()
217- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
218- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
225+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
226+ // ATTACHED-CALL-DAG: call void asm sideeffect
227+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
219228
220229void test_cast_to_void (void ) {
221230 (void ) makeA ();
@@ -228,8 +237,9 @@ void test_cast_to_void(void) {
228237// CHECK-NEXT: ret void
229238
230239// ATTACHED-CALL-LABEL: define{{.*}} void @test_cast_to_void()
231- // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ],
232- // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
240+ // ATTACHED-CALL: [[T0:%.*]] = call ptr @makeA() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
241+ // ATTACHED-CALL-DAG: call void asm sideeffect
242+ // ATTACHED-CALL-NEXT: call void (...) @llvm.objc.clang.arc.noop.use(ptr [[T0]])
233243
234244
235245// This is always at the end of the module.
0 commit comments