blob: a42677ef7849a5587b0bc20fcd9a25dc99772a19 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC
John McCalld1e40d52011-10-02 01:16:38 +00002// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF
David Chisnall11d3f4c2012-07-03 20:49:52 +00003// RUN: %clang_cc1 -fobjc-runtime=gcc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU
4// RUN: %clang_cc1 -fobjc-runtime=gnustep -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF
Daniel Dunbarb21d6af2008-09-04 04:36:23 +00005
6typedef struct {
7 int x;
8 int y;
9 int z[10];
10} MyPoint;
11
12void f0(id a) {
13 int i;
14 MyPoint pt = { 1, 2};
15
Fariborz Jahanianc0ddef22011-03-01 17:28:13 +000016 // CHECK-MAC: call {{.*}} @objc_msgSend to
17 // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
John McCalla1bcc4d2011-02-26 09:12:15 +000018 // CHECK-GNU: call {{.*}} @objc_msg_lookup(
19 // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000020 [a print0];
John McCalla1bcc4d2011-02-26 09:12:15 +000021
22 // CHECK-MAC: call {{.*}} @objc_msgSend to
23 // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
David Chisnallc7ef4622011-03-23 22:52:06 +000024 // CHECK-GNU: call {{.*}} @objc_msg_lookup(
25 // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000026 [a print1: 10];
John McCalla1bcc4d2011-02-26 09:12:15 +000027
28 // CHECK-MAC: call {{.*}} @objc_msgSend to
29 // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
David Chisnallc7ef4622011-03-23 22:52:06 +000030 // CHECK-GNU: call {{.*}} @objc_msg_lookup(
31 // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000032 [a print2: 10 and: "hello" and: 2.2];
John McCalla1bcc4d2011-02-26 09:12:15 +000033
34 // CHECK-MAC: call {{.*}} @objc_msgSend to
35 // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
David Chisnallc7ef4622011-03-23 22:52:06 +000036 // CHECK-GNU: call {{.*}} @objc_msg_lookup(
37 // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000038 [a takeStruct: pt ];
39
40 void *s = @selector(print0);
41 for (i=0; i<2; ++i)
John McCalla1bcc4d2011-02-26 09:12:15 +000042 // CHECK-MAC: call {{.*}} @objc_msgSend to
43 // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
David Chisnallc7ef4622011-03-23 22:52:06 +000044 // CHECK-GNU: call {{.*}} @objc_msg_lookup(
45 // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000046 [a performSelector:s];
47}