• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC
2// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF
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
5
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
16  // CHECK-MAC: call {{.*}} @objc_msgSend to
17  // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
18  // CHECK-GNU: call {{.*}} @objc_msg_lookup(
19  // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
20  [a print0];
21
22  // CHECK-MAC: call {{.*}} @objc_msgSend to
23  // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
24  // CHECK-GNU: call {{.*}} @objc_msg_lookup(
25  // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
26  [a print1: 10];
27
28  // CHECK-MAC: call {{.*}} @objc_msgSend to
29  // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
30  // CHECK-GNU: call {{.*}} @objc_msg_lookup(
31  // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
32  [a print2: 10 and: "hello" and: 2.2];
33
34  // CHECK-MAC: call {{.*}} @objc_msgSend to
35  // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
36  // CHECK-GNU: call {{.*}} @objc_msg_lookup(
37  // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
38  [a takeStruct: pt ];
39
40  void *s = @selector(print0);
41  for (i=0; i<2; ++i)
42    // CHECK-MAC: call {{.*}} @objc_msgSend to
43    // CHECK-MAC-NF: call {{.*}} @objc_msgSend to
44    // CHECK-GNU: call {{.*}} @objc_msg_lookup(
45    // CHECK-GNU-NF: call {{.*}} @objc_msg_lookup_sender(
46    [a performSelector:s];
47}
48