| 1 |
// REQUIRES: powerpc-registered-target |
| 2 |
// RUN: %clang_cc1 -triple powerpc-unknown-aix -target-feature +altivec \ |
| 3 |
// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=AIX32 %s |
| 4 |
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-feature +altivec \ |
| 5 |
// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=AIX64 %s |
| 6 |
|
| 7 |
typedef struct { |
| 8 |
} Zero; |
| 9 |
typedef struct { |
| 10 |
char c; |
| 11 |
} One; |
| 12 |
typedef struct { |
| 13 |
short s; |
| 14 |
} Two; |
| 15 |
typedef struct { |
| 16 |
char c[3]; |
| 17 |
} Three; |
| 18 |
typedef struct { |
| 19 |
float f; |
| 20 |
} Four; |
| 21 |
typedef struct { |
| 22 |
char c[5]; |
| 23 |
} Five; |
| 24 |
typedef struct { |
| 25 |
short s[3]; |
| 26 |
} Six; |
| 27 |
typedef struct { |
| 28 |
char c[7]; |
| 29 |
} Seven; |
| 30 |
typedef struct { |
| 31 |
long long l; |
| 32 |
} Eight; |
| 33 |
typedef struct { |
| 34 |
int i; |
| 35 |
} __attribute__((aligned(32))) OverAligned; |
| 36 |
typedef struct { |
| 37 |
int i; |
| 38 |
vector signed int vsi; |
| 39 |
} StructVector; |
| 40 |
|
| 41 |
// AIX32-LABEL: define void @arg0(ptr noundef byval(%struct.Zero) align 4 %x) |
| 42 |
// AIX64-LABEL: define void @arg0(ptr noundef byval(%struct.Zero) align 8 %x) |
| 43 |
void arg0(Zero x) {} |
| 44 |
|
| 45 |
// AIX32-LABEL: define void @arg1(ptr noundef byval(%struct.One) align 4 %x) |
| 46 |
// AIX64-LABEL: define void @arg1(ptr noundef byval(%struct.One) align 8 %x) |
| 47 |
void arg1(One x) {} |
| 48 |
|
| 49 |
// AIX32-LABEL: define void @arg2(ptr noundef byval(%struct.Two) align 4 %x) |
| 50 |
// AIX64-LABEL: define void @arg2(ptr noundef byval(%struct.Two) align 8 %x) |
| 51 |
void arg2(Two x) {} |
| 52 |
|
| 53 |
// AIX32-LABEL: define void @arg3(ptr noundef byval(%struct.Three) align 4 %x) |
| 54 |
// AIX64-LABEL: define void @arg3(ptr noundef byval(%struct.Three) align 8 %x) |
| 55 |
void arg3(Three x) {} |
| 56 |
|
| 57 |
// AIX32-LABEL: define void @arg4(ptr noundef byval(%struct.Four) align 4 %x) |
| 58 |
// AIX64-LABEL: define void @arg4(ptr noundef byval(%struct.Four) align 8 %x) |
| 59 |
void arg4(Four x) {} |
| 60 |
|
| 61 |
// AIX32-LABEL: define void @arg5(ptr noundef byval(%struct.Five) align 4 %x) |
| 62 |
// AIX64-LABEL: define void @arg5(ptr noundef byval(%struct.Five) align 8 %x) |
| 63 |
void arg5(Five x) {} |
| 64 |
|
| 65 |
// AIX32-LABEL: define void @arg6(ptr noundef byval(%struct.Six) align 4 %x) |
| 66 |
// AIX64-LABEL: define void @arg6(ptr noundef byval(%struct.Six) align 8 %x) |
| 67 |
void arg6(Six x) {} |
| 68 |
|
| 69 |
// AIX32-LABEL: define void @arg7(ptr noundef byval(%struct.Seven) align 4 %x) |
| 70 |
// AIX64-LABEL: define void @arg7(ptr noundef byval(%struct.Seven) align 8 %x) |
| 71 |
void arg7(Seven x) {} |
| 72 |
|
| 73 |
// AIX32-LABEL: define void @arg8(ptr noundef byval(%struct.Eight) align 4 %0) |
| 74 |
// AIX32: %x = alloca %struct.Eight, align 8 |
| 75 |
// AIX32: call void @llvm.memcpy.p0.p0.i32 |
| 76 |
// AIX64-LABEL: define void @arg8(ptr noundef byval(%struct.Eight) align 8 %x) |
| 77 |
void arg8(Eight x) {} |
| 78 |
|
| 79 |
// AIX32-LABEL: define void @arg9(ptr noundef byval(%struct.OverAligned) align 4 %0) |
| 80 |
// AIX32: %x = alloca %struct.OverAligned, align 32 |
| 81 |
// AIX32: call void @llvm.memcpy.p0.p0.i32 |
| 82 |
// AIX64-LABEL: define void @arg9(ptr noundef byval(%struct.OverAligned) align 8 %0) |
| 83 |
// AIX64: %x = alloca %struct.OverAligned, align 32 |
| 84 |
// AIX64: call void @llvm.memcpy.p0.p0.i64 |
| 85 |
void arg9(OverAligned x) {} |
| 86 |
|
| 87 |
// AIX32-LABEL: define void @arg10(ptr noundef byval(%struct.StructVector) align 16 %x) |
| 88 |
// AIX64-LABEL: define void @arg10(ptr noundef byval(%struct.StructVector) align 16 %x) |
| 89 |
void arg10(StructVector x) {} |