John McCall | a1bcc4d | 2011-02-26 09:12:15 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC |
| 2 | // RUN: %clang_cc1 -emit-llvm -fobjc-nonfragile-abi -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF |
| 3 | // RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU |
| 4 | // RUN: %clang_cc1 -fgnu-runtime -fobjc-nonfragile-abi -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 | } |