xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/variadic-sends.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@interface A
5*f4a2713aSLionel Sambuc-(void) im0;
6*f4a2713aSLionel Sambuc-(void) im1: (int) x;
7*f4a2713aSLionel Sambuc-(void) im2: (int) x, ...;
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucvoid f0(A *a) {
11*f4a2713aSLionel Sambuc  // CHECK-X86-32: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)
12*f4a2713aSLionel Sambuc  // CHECK-X86-64: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)
13*f4a2713aSLionel Sambuc  [a im0];
14*f4a2713aSLionel Sambuc}
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambucvoid f1(A *a) {
17*f4a2713aSLionel Sambuc  // CHECK-X86-32: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)
18*f4a2713aSLionel Sambuc  // CHECK-X86-64: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)
19*f4a2713aSLionel Sambuc  [a im1: 1];
20*f4a2713aSLionel Sambuc}
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambucvoid f2(A *a) {
23*f4a2713aSLionel Sambuc  // CHECK-X86-32: call void (i8*, i8*, i32, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*)
24*f4a2713aSLionel Sambuc  // CHECK-X86-64: call void (i8*, i8*, i32, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*)
25*f4a2713aSLionel Sambuc  [a im2: 1, 2];
26*f4a2713aSLionel Sambuc}
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc@interface B : A @end
29*f4a2713aSLionel Sambuc@implementation B : A
30*f4a2713aSLionel Sambuc-(void) foo {
31*f4a2713aSLionel Sambuc  // CHECK-X86-32: call void bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32)*)
32*f4a2713aSLionel Sambuc  // CHECK-X86-64: call void bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32)*)
33*f4a2713aSLionel Sambuc  [super im1: 1];
34*f4a2713aSLionel Sambuc}
35*f4a2713aSLionel Sambuc-(void) bar {
36*f4a2713aSLionel Sambuc  // CHECK-X86-32: call void (%struct._objc_super*, i8*, i32, ...)* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*)
37*f4a2713aSLionel Sambuc  // CHECK-X86-64: call void (%struct._objc_super*, i8*, i32, ...)* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*)
38*f4a2713aSLionel Sambuc  [super im2: 1, 2];
39*f4a2713aSLionel Sambuc}
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambuc@end
42