Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -w -triple i386-pc-elfiamcu -mfloat-abi soft -emit-llvm -o - %s | FileCheck %s |
| 2 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 3 | // CHECK-LABEL: define void @ints(i32 %a, i32 %b, i32 %c, i32 %d) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 4 | void ints(int a, int b, int c, int d) {} |
| 5 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 6 | // CHECK-LABEL: define void @floats(float %a, float %b, float %c, float %d) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 7 | void floats(float a, float b, float c, float d) {} |
| 8 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 9 | // CHECK-LABEL: define void @mixed(i32 %a, float %b, i32 %c, float %d) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 10 | void mixed(int a, float b, int c, float d) {} |
| 11 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 12 | // CHECK-LABEL: define void @doubles(double %d1, double %d2) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 13 | void doubles(double d1, double d2) {} |
| 14 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 15 | // CHECK-LABEL: define void @mixedDoubles(i32 %a, double %d1) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 16 | void mixedDoubles(int a, double d1) {} |
| 17 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 18 | typedef struct st3_t { |
| 19 | char a[3]; |
| 20 | } st3_t; |
| 21 | |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 22 | typedef struct st4_t { |
| 23 | int a; |
| 24 | } st4_t; |
| 25 | |
| 26 | typedef struct st5_t { |
| 27 | int a; |
| 28 | char b; |
| 29 | } st5_t; |
| 30 | |
| 31 | typedef struct st12_t { |
| 32 | int a; |
| 33 | int b; |
| 34 | int c; |
| 35 | } st12_t; |
| 36 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 37 | // CHECK-LABEL: define void @smallStructs(i32 %st1.coerce, i32 %st2.coerce, i32 %st3.coerce) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 38 | void smallStructs(st4_t st1, st4_t st2, st4_t st3) {} |
| 39 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 40 | // CHECK-LABEL: define void @paddedStruct(i32 %i1, i32 %st.coerce0, i32 %st.coerce1, i32 %st4.0) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 41 | void paddedStruct(int i1, st5_t st, st4_t st4) {} |
| 42 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 43 | // CHECK-LABEL: define void @largeStructBegin(%struct.st12_t* byval align 4 %st) |
| 44 | void largeStructBegin(st12_t st) {} |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 45 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 46 | // CHECK-LABEL: define void @largeStructMiddle(i32 %i1, %struct.st12_t* byval align 4 %st, i32 %i2, i32 %i3) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 47 | void largeStructMiddle(int i1, st12_t st, int i2, int i3) {} |
| 48 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 49 | // CHECK-LABEL: define void @largeStructEnd(i32 %i1, i32 %i2, i32 %i3, i32 %st.0, i32 %st.1, i32 %st.2) |
| 50 | void largeStructEnd(int i1, int i2, int i3, st12_t st) {} |
| 51 | |
| 52 | // CHECK-LABEL: define i24 @retNonPow2Struct(i32 %r.coerce) |
| 53 | st3_t retNonPow2Struct(st3_t r) { return r; } |
| 54 | |
| 55 | // CHECK-LABEL: define i32 @retSmallStruct(i32 %r.coerce) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 56 | st4_t retSmallStruct(st4_t r) { return r; } |
| 57 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 58 | // CHECK-LABEL: define i64 @retPaddedStruct(i32 %r.coerce0, i32 %r.coerce1) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 59 | st5_t retPaddedStruct(st5_t r) { return r; } |
| 60 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 61 | // CHECK-LABEL: define void @retLargeStruct(%struct.st12_t* noalias sret %agg.result, i32 %i1, %struct.st12_t* byval align 4 %r) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 62 | st12_t retLargeStruct(int i1, st12_t r) { return r; } |
| 63 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 64 | // CHECK-LABEL: define i32 @varArgs(i32 %i1, ...) |
Michael Kuperstein | 6890188 | 2015-10-25 08:18:20 +0000 | [diff] [blame] | 65 | int varArgs(int i1, ...) { return i1; } |
Andrey Bokhanko | 158b8b8 | 2015-11-02 09:54:17 +0000 | [diff] [blame] | 66 | |
Michael Kuperstein | f3163dc | 2015-12-28 14:39:54 +0000 | [diff] [blame] | 67 | // CHECK-LABEL: define double @longDoubleArg(double %ld1) |
Andrey Bokhanko | 158b8b8 | 2015-11-02 09:54:17 +0000 | [diff] [blame] | 68 | long double longDoubleArg(long double ld1) { return ld1; } |
| 69 | |