Fariborz Jahanian | 37530fc | 2009-05-23 17:03:50 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s && |
| 2 | // RUN: grep "objc_msgSend" %t | count 6 && |
Fariborz Jahanian | 6c9b315 | 2009-06-01 17:40:54 +0000 | [diff] [blame^] | 3 | // RUN: clang-cc -fgnu-runtime --emit-llvm -o %t %s && |
| 4 | // RUN: grep "objc_msg_lookup" %t | count 6 && |
| 5 | // RUN: clang-cc -fgnu-runtime -fobjc-sender-dependent-dispatch --emit-llvm -o %t %s && |
| 6 | // RUN: grep "objc_msg_lookup_sender" %t | count 6 |
Fariborz Jahanian | 37530fc | 2009-05-23 17:03:50 +0000 | [diff] [blame] | 7 | // RUN: true |
Daniel Dunbar | b21d6af | 2008-09-04 04:36:23 +0000 | [diff] [blame] | 8 | |
| 9 | typedef struct { |
| 10 | int x; |
| 11 | int y; |
| 12 | int z[10]; |
| 13 | } MyPoint; |
| 14 | |
| 15 | void f0(id a) { |
| 16 | int i; |
| 17 | MyPoint pt = { 1, 2}; |
| 18 | |
| 19 | [a print0]; |
| 20 | [a print1: 10]; |
| 21 | [a print2: 10 and: "hello" and: 2.2]; |
| 22 | [a takeStruct: pt ]; |
| 23 | |
| 24 | void *s = @selector(print0); |
| 25 | for (i=0; i<2; ++i) |
| 26 | [a performSelector:s]; |
| 27 | } |