1// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-abi apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s 2// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-abi aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=AAPCS %s 3 4// APCS-GNU: define signext i8 @f0() 5// AAPCS: define arm_aapcscc signext i8 @f0() 6char f0(void) { 7 return 0; 8} 9 10// APCS-GNU: define i8 @f1() 11// AAPCS: define arm_aapcscc i8 @f1() 12struct s1 { char f0; }; 13struct s1 f1(void) {} 14 15// APCS-GNU: define i16 @f2() 16// AAPCS: define arm_aapcscc i16 @f2() 17struct s2 { short f0; }; 18struct s2 f2(void) {} 19 20// APCS-GNU: define i32 @f3() 21// AAPCS: define arm_aapcscc i32 @f3() 22struct s3 { int f0; }; 23struct s3 f3(void) {} 24 25// APCS-GNU: define i32 @f4() 26// AAPCS: define arm_aapcscc i32 @f4() 27struct s4 { struct s4_0 { int f0; } f0; }; 28struct s4 f4(void) {} 29 30// APCS-GNU: define void @f5( 31// APCS-GNU: struct.s5* noalias sret 32// AAPCS: define arm_aapcscc i32 @f5() 33struct s5 { struct { } f0; int f1; }; 34struct s5 f5(void) {} 35 36// APCS-GNU: define void @f6( 37// APCS-GNU: struct.s6* noalias sret 38// AAPCS: define arm_aapcscc i32 @f6() 39struct s6 { int f0[1]; }; 40struct s6 f6(void) {} 41 42// APCS-GNU: define void @f7() 43// AAPCS: define arm_aapcscc void @f7() 44struct s7 { struct { int : 0; } f0; }; 45struct s7 f7(void) {} 46 47// APCS-GNU: define void @f8( 48// APCS-GNU: struct.s8* noalias sret 49// AAPCS: define arm_aapcscc void @f8() 50struct s8 { struct { int : 0; } f0[1]; }; 51struct s8 f8(void) {} 52 53// APCS-GNU: define i32 @f9() 54// AAPCS: define arm_aapcscc i32 @f9() 55struct s9 { int f0; int : 0; }; 56struct s9 f9(void) {} 57 58// APCS-GNU: define i32 @f10() 59// AAPCS: define arm_aapcscc i32 @f10() 60struct s10 { int f0; int : 0; int : 0; }; 61struct s10 f10(void) {} 62 63// APCS-GNU: define void @f11( 64// APCS-GNU: struct.s11* noalias sret 65// AAPCS: define arm_aapcscc i32 @f11() 66struct s11 { int : 0; int f0; }; 67struct s11 f11(void) {} 68 69// APCS-GNU: define i32 @f12() 70// AAPCS: define arm_aapcscc i32 @f12() 71union u12 { char f0; short f1; int f2; }; 72union u12 f12(void) {} 73 74// APCS-GNU: define void @f13( 75// APCS-GNU: struct.s13* noalias sret 76 77// FIXME: This should return a float. 78// AAPCS-FIXME: darm_aapcscc efine float @f13() 79struct s13 { float f0; }; 80struct s13 f13(void) {} 81 82// APCS-GNU: define void @f14( 83// APCS-GNU: union.u14* noalias sret 84// AAPCS: define arm_aapcscc i32 @f14() 85union u14 { float f0; }; 86union u14 f14(void) {} 87 88// APCS-GNU: define void @f15() 89// AAPCS: define arm_aapcscc void @f15() 90void f15(struct s7 a0) {} 91 92// APCS-GNU: define void @f16() 93// AAPCS: define arm_aapcscc void @f16() 94void f16(struct s8 a0) {} 95 96// APCS-GNU: define i32 @f17() 97// AAPCS: define arm_aapcscc i32 @f17() 98struct s17 { short f0 : 13; char f1 : 4; }; 99struct s17 f17(void) {} 100 101// APCS-GNU: define i32 @f18() 102// AAPCS: define arm_aapcscc i32 @f18() 103struct s18 { short f0; char f1 : 4; }; 104struct s18 f18(void) {} 105 106// APCS-GNU: define void @f19( 107// APCS-GNU: struct.s19* noalias sret 108// AAPCS: define arm_aapcscc i32 @f19() 109struct s19 { int f0; struct s8 f1; }; 110struct s19 f19(void) {} 111 112// APCS-GNU: define void @f20( 113// APCS-GNU: struct.s20* noalias sret 114// AAPCS: define arm_aapcscc i32 @f20() 115struct s20 { struct s8 f1; int f0; }; 116struct s20 f20(void) {} 117 118// APCS-GNU: define i8 @f21() 119// AAPCS: define arm_aapcscc i32 @f21() 120struct s21 { struct {} f1; int f0 : 4; }; 121struct s21 f21(void) {} 122 123// APCS-GNU: define i16 @f22() 124// APCS-GNU: define i32 @f23() 125// APCS-GNU: define i64 @f24() 126// APCS-GNU: define i128 @f25() 127// APCS-GNU: define i64 @f26() 128// APCS-GNU: define i128 @f27() 129// AAPCS: define arm_aapcscc i16 @f22() 130// AAPCS: define arm_aapcscc i32 @f23() 131// AAPCS: define arm_aapcscc void @f24({{.*}} noalias sret 132// AAPCS: define arm_aapcscc void @f25({{.*}} noalias sret 133// AAPCS: define arm_aapcscc void @f26({{.*}} noalias sret 134// AAPCS: define arm_aapcscc void @f27({{.*}} noalias sret 135_Complex char f22(void) {} 136_Complex short f23(void) {} 137_Complex int f24(void) {} 138_Complex long long f25(void) {} 139_Complex float f26(void) {} 140_Complex double f27(void) {} 141 142// APCS-GNU: define i16 @f28() 143// AAPCS: define arm_aapcscc i16 @f28() 144struct s28 { _Complex char f0; }; 145struct s28 f28() {} 146 147// APCS-GNU: define i32 @f29() 148// AAPCS: define arm_aapcscc i32 @f29() 149struct s29 { _Complex short f0; }; 150struct s29 f29() {} 151 152// APCS-GNU: define void @f30({{.*}} noalias sret 153// AAPCS: define arm_aapcscc void @f30({{.*}} noalias sret 154struct s30 { _Complex int f0; }; 155struct s30 f30() {} 156