John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC |
John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF |
David Chisnall | 11d3f4c | 2012-07-03 20:49:52 +0000 | [diff] [blame] | 3 | // 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 Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 5 | |
| 6 | typedef struct { |
| 7 | int x; |
| 8 | int y; |
| 9 | int z[10]; |
| 10 | } MyPoint; |
| 11 | |
| 12 | void f0(id a) { |
| 13 | int i; |
| 14 | MyPoint pt = { 1, 2}; |
| 15 | |
Fariborz Jahanian | c0ddef2 | 2011-03-01 17:28:13 +0000 | [diff] [blame] | 16 | // CHECK-MAC: call {{.*}} @objc_msgSend to |
| 17 | // CHECK-MAC-NF: call {{.*}} @objc_msgSend to |
John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 18 | // CHECK-GNU: call {{.*}} @objc_msg_lookup( |
| 19 | // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender( |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 20 | [a print0]; |
John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 21 | |
| 22 | // CHECK-MAC: call {{.*}} @objc_msgSend to |
| 23 | // CHECK-MAC-NF: call {{.*}} @objc_msgSend to |
David Chisnall | c7ef462 | 2011-03-23 22:52:06 +0000 | [diff] [blame] | 24 | // CHECK-GNU: call {{.*}} @objc_msg_lookup( |
| 25 | // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender( |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 26 | [a print1: 10]; |
John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 27 | |
| 28 | // CHECK-MAC: call {{.*}} @objc_msgSend to |
| 29 | // CHECK-MAC-NF: call {{.*}} @objc_msgSend to |
David Chisnall | c7ef462 | 2011-03-23 22:52:06 +0000 | [diff] [blame] | 30 | // CHECK-GNU: call {{.*}} @objc_msg_lookup( |
| 31 | // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender( |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 32 | [a print2: 10 and: "hello" and: 2.2]; |
John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 33 | |
| 34 | // CHECK-MAC: call {{.*}} @objc_msgSend to |
| 35 | // CHECK-MAC-NF: call {{.*}} @objc_msgSend to |
David Chisnall | c7ef462 | 2011-03-23 22:52:06 +0000 | [diff] [blame] | 36 | // CHECK-GNU: call {{.*}} @objc_msg_lookup( |
| 37 | // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender( |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 38 | [a takeStruct: pt ]; |
| 39 | |
| 40 | void *s = @selector(print0); |
| 41 | for (i=0; i<2; ++i) |
John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 42 | // CHECK-MAC: call {{.*}} @objc_msgSend to |
| 43 | // CHECK-MAC-NF: call {{.*}} @objc_msgSend to |
David Chisnall | c7ef462 | 2011-03-23 22:52:06 +0000 | [diff] [blame] | 44 | // CHECK-GNU: call {{.*}} @objc_msg_lookup( |
| 45 | // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender( |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 46 | [a performSelector:s]; |
| 47 | } |