blob: 9cb4b134e67d5ff3a71b9aa2fea4d9c201c6cda7 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck %s
Anders Carlsson25c92e62009-12-24 20:21:41 +00002struct Coerce {
3 id a;
4};
5
6struct Coerce coerce_func(void);
7
Stephen Lin93ab6bf2013-08-15 06:47:53 +00008// CHECK-LABEL: define void @Coerce_test()
Anders Carlsson25c92e62009-12-24 20:21:41 +00009void Coerce_test(void) {
10 struct Coerce c;
11
Chris Lattner4711cb02010-07-29 04:46:19 +000012 // CHECK: call i8* @coerce_func
Anders Carlsson25c92e62009-12-24 20:21:41 +000013 // CHECK: call i8* @objc_memmove_collectable(
14 c = coerce_func();
15}
16
17struct Indirect {
18 id a;
19 int b[10];
20};
21
22struct Indirect indirect_func(void);
23
Stephen Lin93ab6bf2013-08-15 06:47:53 +000024// CHECK-LABEL: define void @Indirect_test()
Anders Carlsson25c92e62009-12-24 20:21:41 +000025void Indirect_test(void) {
26 struct Indirect i;
27
Chris Lattnerfb97cf22010-04-20 05:44:43 +000028 // CHECK: call void @indirect_func(%struct.Indirect* sret
Anders Carlsson25c92e62009-12-24 20:21:41 +000029 // CHECK: call i8* @objc_memmove_collectable(
30 i = indirect_func();
31}