2011-10-02 05:16:38 +04:00
|
|
|
// RUN: %clang_cc1 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC
|
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF
|
|
|
|
// RUN: %clang_cc1 -fobjc-fragile-abi -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU
|
|
|
|
// RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF
|
2008-09-04 08:36:23 +04:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int z[10];
|
|
|
|
} MyPoint;
|
|
|
|
|
|
|
|
void f0(id a) {
|
|
|
|
int i;
|
|
|
|
MyPoint pt = { 1, 2};
|
|
|
|
|
2011-03-01 20:28:13 +03:00
|
|
|
// CHECK-MAC: call {{.*}} @objc_msgSend to
|
|
|
|
// CHECK-MAC-NF: call {{.*}} @objc_msgSend to
|
2011-02-26 12:12:15 +03:00
|
|
|
// CHECK-GNU: call {{.*}} @objc_msg_lookup(
|
|
|
|
// CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
|
2008-09-04 08:36:23 +04:00
|
|
|
[a print0];
|
2011-02-26 12:12:15 +03:00
|
|
|
|
|
|
|
// CHECK-MAC: call {{.*}} @objc_msgSend to
|
|
|
|
// CHECK-MAC-NF: call {{.*}} @objc_msgSend to
|
2011-03-24 01:52:06 +03:00
|
|
|
// CHECK-GNU: call {{.*}} @objc_msg_lookup(
|
|
|
|
// CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
|
2008-09-04 08:36:23 +04:00
|
|
|
[a print1: 10];
|
2011-02-26 12:12:15 +03:00
|
|
|
|
|
|
|
// CHECK-MAC: call {{.*}} @objc_msgSend to
|
|
|
|
// CHECK-MAC-NF: call {{.*}} @objc_msgSend to
|
2011-03-24 01:52:06 +03:00
|
|
|
// CHECK-GNU: call {{.*}} @objc_msg_lookup(
|
|
|
|
// CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
|
2008-09-04 08:36:23 +04:00
|
|
|
[a print2: 10 and: "hello" and: 2.2];
|
2011-02-26 12:12:15 +03:00
|
|
|
|
|
|
|
// CHECK-MAC: call {{.*}} @objc_msgSend to
|
|
|
|
// CHECK-MAC-NF: call {{.*}} @objc_msgSend to
|
2011-03-24 01:52:06 +03:00
|
|
|
// CHECK-GNU: call {{.*}} @objc_msg_lookup(
|
|
|
|
// CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
|
2008-09-04 08:36:23 +04:00
|
|
|
[a takeStruct: pt ];
|
|
|
|
|
|
|
|
void *s = @selector(print0);
|
|
|
|
for (i=0; i<2; ++i)
|
2011-02-26 12:12:15 +03:00
|
|
|
// CHECK-MAC: call {{.*}} @objc_msgSend to
|
|
|
|
// CHECK-MAC-NF: call {{.*}} @objc_msgSend to
|
2011-03-24 01:52:06 +03:00
|
|
|
// CHECK-GNU: call {{.*}} @objc_msg_lookup(
|
|
|
|
// CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
|
2008-09-04 08:36:23 +04:00
|
|
|
[a performSelector:s];
|
|
|
|
}
|