// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple armv7-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple armv7s-apple-ios9 -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple armv7k-apple-ios9 -emit-llvm -o - %s | FileCheck %s
/*****************************************************************************/
/****************************** PARAMETER ABIS *******************************/
/*****************************************************************************/
SWIFTCALL void
// CHECK-LABEL: define{{.*}} void @indirect_result_1(i32* noalias sret(i32*) align 4 dereferenceable(4){{.*}}, float* noalias align 4 dereferenceable(4){{.*}})
// TODO: maybe this shouldn't suppress sret.
SWIFTCALL int
// CHECK-LABEL: define{{.*}} i32 @indirect_result_2(i32* noalias align 4 dereferenceable(4){{.*}}, float* noalias align 4 dereferenceable(4){{.*}})
typedef struct struct_reallybig;
SWIFTCALL struct_reallybig
// CHECK-LABEL: define{{.*}} void @indirect_result_3({{.*}}* noalias sret(%struct.struct_reallybig) {{.*}}, i32* noalias align 4 dereferenceable(4){{.*}}, float* noalias align 4 dereferenceable(4){{.*}})
SWIFTCALL void
// CHECK-LABEL: define{{.*}} void @context_1(i8* swiftself
SWIFTASYNCCALL void
// CHECK-LABEL: define{{.*}} void @async_context_1(i8* swiftasync
SWIFTCALL void
// CHECK-LABEL: define{{.*}} void @context_2(i8*{{.*}}, i8* swiftself
SWIFTASYNCCALL void
// CHECK-LABEL: define{{.*}} void @async_context_2(i8*{{.*}}, i8* swiftasync
SWIFTCALL void
// CHECK-LABEL: define{{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror %0)
// CHECK: [[TEMP:%.*]] = alloca float*, align 4
// CHECK: [[T0:%.*]] = load float*, float** [[ERRORARG:%.*]], align 4
// CHECK: store float* [[T0]], float** [[TEMP]], align 4
// CHECK: [[T0:%.*]] = load float*, float** [[TEMP]], align 4
// CHECK: store float* [[T0]], float** [[ERRORARG]], align 4
void
// CHECK-LABEL: define{{.*}} void @test_context_error_1()
// CHECK: [[X:%.*]] = alloca i32, align 4
// CHECK: [[ERROR:%.*]] = alloca float*, align 4
// CHECK: [[TEMP:%.*]] = alloca swifterror float*, align 4
// CHECK: [[T0:%.*]] = load float*, float** [[ERROR]], align 4
// CHECK: store float* [[T0]], float** [[TEMP]], align 4
// CHECK: call [[SWIFTCC:swiftcc]] void @context_error_1(i32* swiftself [[X]], float** swifterror [[TEMP]])
// CHECK: [[T0:%.*]] = load float*, float** [[TEMP]], align 4
// CHECK: store float* [[T0]], float** [[ERROR]], align 4
SWIFTCALL void
// CHECK-LABEL: define{{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror %0)
/*****************************************************************************/
/********************************** LOWERING *********************************/
/*****************************************************************************/
typedef float float3 ;
typedef float float4 ;
typedef float float8 ;
typedef double double2 ;
typedef double double4 ;
typedef int int3 ;
typedef int int4 ;
typedef int int5 ;
typedef int int8 ;
typedef char char16 ;
typedef short short8 ;
typedef long long long2 ;
/*****************************************************************************/
/*********************************** STRUCTS *********************************/
/*****************************************************************************/
typedef struct struct_empty;
;
// CHECK-LABEL: define{{.*}} @return_struct_empty()
// CHECK: ret void
// CHECK-LABEL: define{{.*}} @take_struct_empty()
// CHECK: ret void
typedef struct struct_1;
;
// CHECK-LABEL: define{{.*}} @return_struct_1()
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align 4
// CHECK: @llvm.memset
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, i16, \[2 x i8\], float, float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i16, i16* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 4
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i16, float, float }]] poison, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i16 [[SECOND]], 1
// CHECK: [[T2:%.*]] = insertvalue [[UAGG]] [[T1]], float [[THIRD]], 2
// CHECK: [[T3:%.*]] = insertvalue [[UAGG]] [[T2]], float [[FOURTH]], 3
// CHECK: ret [[UAGG]] [[T3]]
// CHECK-LABEL: define{{.*}} @take_struct_1(i32 %0, i16 %1, float %2, float %3)
// CHECK: [[V:%.*]] = alloca [[REC]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store i32 %0, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store i16 %1, i16* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: store float %2, float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 4
// CHECK: store float %3, float* [[T0]], align 4
// CHECK: ret void
// CHECK-LABEL: define{{.*}} void @test_struct_1()
// CHECK: [[TMP:%.*]] = alloca [[REC]], align 4
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_struct_1()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store i32 [[T1]], i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store i16 [[T1]], i16* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 2
// CHECK: store float [[T1]], float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 4
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 3
// CHECK: store float [[T1]], float* [[T0]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i16, i16* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 4
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align 4
// CHECK: call [[SWIFTCC]] void @take_struct_1(i32 [[FIRST]], i16 [[SECOND]], float [[THIRD]], float [[FOURTH]])
// CHECK: ret void
typedef struct struct_2;
;
// CHECK-LABEL: define{{.*}} @return_struct_2()
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align 4
// CHECK: @llvm.memcpy
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, i32, float, float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i32, float, float }]] poison, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: [[T2:%.*]] = insertvalue [[UAGG]] [[T1]], float [[THIRD]], 2
// CHECK: [[T3:%.*]] = insertvalue [[UAGG]] [[T2]], float [[FOURTH]], 3
// CHECK: ret [[UAGG]] [[T3]]
// CHECK-LABEL: define{{.*}} @take_struct_2(i32 %0, i32 %1, float %2, float %3)
// CHECK: [[V:%.*]] = alloca [[REC]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store i32 %0, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store i32 %1, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: store float %2, float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: store float %3, float* [[T0]], align 4
// CHECK: ret void
// CHECK-LABEL: define{{.*}} void @test_struct_2()
// CHECK: [[TMP:%.*]] = alloca [[REC]], align 4
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_struct_2()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store i32 [[T1]], i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store i32 [[T1]], i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 2
// CHECK: store float [[T1]], float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 3
// CHECK: store float [[T1]], float* [[T0]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align 4
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align 4
// CHECK: call [[SWIFTCC]] void @take_struct_2(i32 [[FIRST]], i32 [[SECOND]], float [[THIRD]], float [[FOURTH]])
// CHECK: ret void
// There's no way to put a field randomly in the middle of an otherwise
// empty storage unit in C, so that case has to be tested in C++, which
// can use empty structs to introduce arbitrary padding. (In C, they end up
// with size 0 and so don't affect layout.)
// Misaligned data rule.
typedef struct struct_misaligned_1;
// CHECK-LABEL: define{{.*}} @return_struct_misaligned_1()
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align
// CHECK: @llvm.memset
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, i8 }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i8, i8* [[T0]], align
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i8 }]] poison, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i8 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
// CHECK-LABEL: define{{.*}} @take_struct_misaligned_1(i32 %0, i8 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store i32 %0, i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store i8 %1, i8* [[T0]], align
// CHECK: ret void
// Too many scalars.
typedef struct struct_big_1;
// CHECK-LABEL: define{{.*}} void @return_struct_big_1({{.*}} noalias sret({{.*}})
// Should not be byval.
// CHECK-LABEL: define{{.*}} void @take_struct_big_1({{.*}}*{{( %.*)?}})
/*****************************************************************************/
/********************************* TYPE MERGING ******************************/
/*****************************************************************************/
typedef union union_het_fp;
// CHECK-LABEL: define{{.*}} @return_union_het_fp()
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align {{(4|8)}}
// CHECK: @llvm.memcpy
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, i32 }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align {{(4|8)}}
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align {{(4|8)}}
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i32 }]] poison, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
// CHECK-LABEL: define{{.*}} @take_union_het_fp(i32 %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align {{(4|8)}}
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store i32 %0, i32* [[T0]], align {{(4|8)}}
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store i32 %1, i32* [[T0]], align {{(4|8)}}
// CHECK: ret void
// CHECK-LABEL: define{{.*}} void @test_union_het_fp()
// CHECK: [[TMP:%.*]] = alloca [[REC]], align {{(4|8)}}
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_union_het_fp()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store i32 [[T1]], i32* [[T0]], align {{(4|8)}}
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store i32 [[T1]], i32* [[T0]], align {{(4|8)}}
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align {{(4|8)}}
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align {{(4|8)}}
// CHECK: call [[SWIFTCC]] void @take_union_het_fp(i32 [[FIRST]], i32 [[SECOND]])
// CHECK: ret void
typedef union union_hom_fp;
// CHECK-LABEL: define{{.*}} void @test_union_hom_fp()
// CHECK: [[TMP:%.*]] = alloca [[REC:%.*]], align 4
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] float @return_union_hom_fp()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG:{ float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store float [[CALL]], float* [[T0]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load float, float* [[T0]], align 4
// CHECK: call [[SWIFTCC]] void @take_union_hom_fp(float [[FIRST]])
// CHECK: ret void
typedef union union_hom_fp_partial;
// CHECK-LABEL: define{{.*}} void @test_union_hom_fp_partial()
// CHECK: [[TMP:%.*]] = alloca [[REC:%.*]], align 16
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG:{ float, float, float, float }]] @return_union_hom_fp_partial()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG:{ float, float, float, float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 2
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 3
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align
// CHECK: call [[SWIFTCC]] void @take_union_hom_fp_partial(float [[FIRST]], float [[SECOND]], float [[THIRD]], float [[FOURTH]])
// CHECK: ret void
typedef union union_het_fpv_partial;
// CHECK-LABEL: define{{.*}} void @test_union_het_fpv_partial()
// CHECK: [[TMP:%.*]] = alloca [[REC:%.*]], align 16
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG:{ i32, i32, float, float }]] @return_union_het_fpv_partial()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG:{ i32, i32, float, float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store i32 [[T1]], i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store i32 [[T1]], i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 2
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 3
// CHECK: store float [[T1]], float* [[T0]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 2
// CHECK: [[THIRD:%.*]] = load float, float* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 3
// CHECK: [[FOURTH:%.*]] = load float, float* [[T0]], align
// CHECK: call [[SWIFTCC]] void @take_union_het_fpv_partial(i32 [[FIRST]], i32 [[SECOND]], float [[THIRD]], float [[FOURTH]])
// CHECK: ret void
/*****************************************************************************/
/****************************** VECTOR LEGALIZATION **************************/
/*****************************************************************************/
// CHECK-LABEL: define{{.*}} <4 x i32> @return_int4()
// CHECK-LABEL: define{{.*}} @take_int4(<4 x i32>
// CHECK-LABEL: define{{.*}} @return_int8()
// CHECK: [[RET:%.*]] = alloca [[REC:<8 x i32>]], align 32
// CHECK: store
// CHECK: load
// CHECK: store
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ <4 x i32>, <4 x i32> }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, <4 x i32> }]] poison, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], <4 x i32> [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
// CHECK-LABEL: define{{.*}} @take_int8(<4 x i32> %0, <4 x i32> %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store <4 x i32> %0, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store <4 x i32> %1, <4 x i32>* [[T0]], align
// CHECK: ret void
// CHECK-LABEL: define{{.*}} void @test_int8()
// CHECK: [[TMP1:%.*]] = alloca [[REC]], align
// CHECK: [[TMP2:%.*]] = alloca [[REC]], align
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_int8()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP1]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store <4 x i32> [[T1]], <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store <4 x i32> [[T1]], <4 x i32>* [[T0]], align
// CHECK: [[V:%.*]] = load [[REC]], [[REC]]* [[TMP1]], align
// CHECK: store [[REC]] [[V]], [[REC]]* [[TMP2]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP2]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: call [[SWIFTCC]] void @take_int8(<4 x i32> [[FIRST]], <4 x i32> [[SECOND]])
// CHECK: ret void
// CHECK-LABEL: define{{.*}} @return_int5()
// CHECK: [[RET:%.*]] = alloca [[REC:<5 x i32>]], align 32
// CHECK: store
// CHECK: load
// CHECK: store
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ <4 x i32>, i32 }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, i32 }]] poison, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
// CHECK-LABEL: define{{.*}} @take_int5(<4 x i32> %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: store <4 x i32> %0, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: store i32 %1, i32* [[T0]], align
// CHECK: ret void
// CHECK-LABEL: define{{.*}} void @test_int5()
// CHECK: [[TMP1:%.*]] = alloca [[REC]], align
// CHECK: [[TMP2:%.*]] = alloca [[REC]], align
// CHECK: [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_int5()
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP1]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 0
// CHECK: store <4 x i32> [[T1]], <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[T1:%.*]] = extractvalue [[UAGG]] [[CALL]], 1
// CHECK: store i32 [[T1]], i32* [[T0]], align
// CHECK: [[V:%.*]] = load [[REC]], [[REC]]* [[TMP1]], align
// CHECK: store [[REC]] [[V]], [[REC]]* [[TMP2]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP2]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load <4 x i32>, <4 x i32>* [[T0]], align
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align
// CHECK: call [[SWIFTCC]] void @take_int5(<4 x i32> [[FIRST]], i32 [[SECOND]])
// CHECK: ret void
typedef struct misaligned_int3;
// CHECK-LABEL: define{{.*}} @take_misaligned_int3(i32 %0, i32 %1, i32 %2, i32 %3)
typedef struct struct_f1;
// CHECK-LABEL: define{{.*}} swiftcc float @return_struct_f1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_f1(float %0)
typedef struct struct_f2;
// CHECK-LABEL: define{{.*}} swiftcc { float, float } @return_struct_f2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_f2(float %0, float %1)
typedef struct struct_f3;
// CHECK-LABEL: define{{.*}} swiftcc { float, float, float } @return_struct_f3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_f3(float %0, float %1, float %2)
typedef struct struct_f4;
// CHECK-LABEL: define{{.*}} swiftcc { float, float, float, float } @return_struct_f4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_f4(float %0, float %1, float %2, float %3)
typedef struct struct_d1;
// CHECK-LABEL: define{{.*}} swiftcc double @return_struct_d1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_d1(double %0)
typedef struct struct_d2;
// CHECK-LABEL: define{{.*}} swiftcc { double, double } @return_struct_d2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_d2(double %0, double %1)
typedef struct struct_d3;
// CHECK-LABEL: define{{.*}} swiftcc { double, double, double } @return_struct_d3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_d3(double %0, double %1, double %2)
typedef struct struct_d4;
// CHECK-LABEL: define{{.*}} swiftcc { double, double, double, double } @return_struct_d4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_d4(double %0, double %1, double %2, double %3)
typedef struct struct_d5;
// CHECK: define{{.*}} swiftcc void @return_struct_d5([[STRUCT5:%.*]]* noalias sret([[STRUCT5]])
// CHECK: define{{.*}} swiftcc void @take_struct_d5([[STRUCT5]]
typedef struct struct_c1;
// CHECK-LABEL: define{{.*}} swiftcc i8 @return_struct_c1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_c1(i8 %0)
typedef struct struct_c2;
// CHECK-LABEL: define{{.*}} swiftcc i16 @return_struct_c2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_c2(i16 %0)
//
typedef struct struct_c3;
// CHECK-LABEL: define{{.*}} swiftcc i32 @return_struct_c3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_c3(i32 %0)
typedef struct struct_c4;
// CHECK-LABEL: define{{.*}} swiftcc i32 @return_struct_c4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_c4(i32 %0)
typedef struct struct_c5;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i8 } @return_struct_c5()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_c5(i32 %0, i8 %1)
typedef struct struct_s1;
// CHECK-LABEL: define{{.*}} swiftcc i16 @return_struct_s1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_s1(i16 %0)
typedef struct struct_s2;
// CHECK-LABEL: define{{.*}} swiftcc i32 @return_struct_s2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_s2(i32 %0)
typedef struct struct_s3;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i16 } @return_struct_s3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_s3(i32 %0, i16 %1)
typedef struct struct_s4;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i32 } @return_struct_s4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_s4(i32 %0, i32 %1)
typedef struct struct_s5;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i32, i16 } @return_struct_s5()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_s5(i32 %0, i32 %1, i16 %2)
typedef struct struct_i1;
// CHECK-LABEL: define{{.*}} swiftcc i32 @return_struct_i1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_i1(i32 %0)
typedef struct struct_i2;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i32 } @return_struct_i2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_i2(i32 %0, i32 %1)
typedef struct struct_i3;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i32, i32 } @return_struct_i3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_i3(i32 %0, i32 %1, i32 %2)
typedef struct struct_i4;
// CHECK-LABEL: define{{.*}} swiftcc { i32, i32, i32, i32 } @return_struct_i4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_i4(i32 %0, i32 %1, i32 %2, i32 %3)
typedef struct struct_l1;
// CHECK-LABEL: define{{.*}} swiftcc i64 @return_struct_l1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_l1(i64 %0)
typedef struct struct_l2;
// CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @return_struct_l2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_l2(i64 %0, i64 %1)
typedef struct struct_l3;
// CHECK: define{{.*}} swiftcc void @return_struct_l3([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_l3([[STRUCT]]
typedef struct struct_l4;
// CHECK: define{{.*}} swiftcc void @return_struct_l4([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_l4([[STRUCT]]
typedef struct struct_l5;
// CHECK: define{{.*}} swiftcc void @return_struct_l5([[STRUCT5:%.*]]* noalias sret([[STRUCT5]])
// CHECK: define{{.*}} swiftcc void @take_struct_l5([[STRUCT5]]*
typedef struct struct_vc1;
// CHECK-LABEL: define{{.*}} swiftcc <16 x i8> @return_struct_vc1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vc1(<16 x i8> %0)
typedef struct struct_vc2;
// CHECK-LABEL: define{{.*}} swiftcc { <16 x i8>, <16 x i8> } @return_struct_vc2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vc2(<16 x i8> %0, <16 x i8> %1)
typedef struct struct_vc3;
// CHECK-LABEL: define{{.*}} swiftcc { <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vc3(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2)
typedef struct struct_vc4;
// CHECK-LABEL: define{{.*}} swiftcc { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vc4(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2, <16 x i8> %3)
typedef struct struct_vc5;
// CHECK: define{{.*}} swiftcc void @return_struct_vc5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vc5([[STRUCT]]
typedef struct struct_vs1;
// CHECK-LABEL: define{{.*}} swiftcc <8 x i16> @return_struct_vs1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vs1(<8 x i16> %0)
typedef struct struct_vs2;
// CHECK-LABEL: define{{.*}} swiftcc { <8 x i16>, <8 x i16> } @return_struct_vs2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vs2(<8 x i16> %0, <8 x i16> %1)
typedef struct struct_vs3;
// CHECK-LABEL: define{{.*}} swiftcc { <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vs3(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2)
typedef struct struct_vs4;
// CHECK-LABEL: define{{.*}} swiftcc { <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vs4(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2, <8 x i16> %3)
typedef struct struct_vs5;
// CHECK: define{{.*}} swiftcc void @return_struct_vs5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vs5([[STRUCT]]
typedef struct struct_vi1;
// CHECK-LABEL: define{{.*}} swiftcc <4 x i32> @return_struct_vi1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vi1(<4 x i32> %0)
typedef struct struct_vi2;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x i32>, <4 x i32> } @return_struct_vi2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vi2(<4 x i32> %0, <4 x i32> %1)
typedef struct struct_vi3;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vi3(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2)
typedef struct struct_vi4;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vi4(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2, <4 x i32> %3)
typedef struct struct_vi5;
// CHECK: define{{.*}} swiftcc void @return_struct_vi5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vi5([[STRUCT]]
typedef struct struct_vl1;
// CHECK-LABEL: define{{.*}} swiftcc <2 x i64> @return_struct_vl1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vl1(<2 x i64> %0)
typedef struct struct_vl4;
// CHECK-LABEL: define{{.*}} swiftcc { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @return_struct_vl4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vl4(<2 x i64> %0, <2 x i64> %1, <2 x i64> %2, <2 x i64> %3)
typedef struct struct_vl5;
// CHECK: define{{.*}} swiftcc void @return_struct_vl5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vl5([[STRUCT]]
typedef struct struct_vd1;
// CHECK-LABEL: define{{.*}} swiftcc <2 x double> @return_struct_vd1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vd1(<2 x double> %0)
typedef struct struct_vd4;
// CHECK-LABEL: define{{.*}} swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vd4(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct struct_vd5;
// CHECK: define{{.*}} swiftcc void @return_struct_vd5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vd5([[STRUCT]]
typedef struct struct_vd41;
// CHECK-LABEL: define{{.*}} swiftcc { <2 x double>, <2 x double> } @return_struct_vd41()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vd41(<2 x double> %0, <2 x double> %1)
typedef struct struct_vd42;
// CHECK-LABEL: define{{.*}} swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd42()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vd42(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct struct_vd43;
// CHECK: define{{.*}} swiftcc void @return_struct_vd43([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vd43([[STRUCT]]
typedef struct struct_vf1;
// CHECK-LABEL: define{{.*}} swiftcc <4 x float> @return_struct_vf1()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vf1(<4 x float> %0)
typedef struct struct_vf2;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x float>, <4 x float> } @return_struct_vf2()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vf2(<4 x float> %0, <4 x float> %1)
typedef struct struct_vf4;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x float>, <4 x float>, <4 x float>, <4 x float> } @return_struct_vf4()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vf4(<4 x float> %0, <4 x float> %1, <4 x float> %2, <4 x float> %3)
typedef struct struct_vf5;
// CHECK: define{{.*}} swiftcc void @return_struct_vf5([[STRUCT:%.*]]* noalias sret([[STRUCT]])
// CHECK: define{{.*}} swiftcc void @take_struct_vf5([[STRUCT]]
typedef struct struct_vf81;
// CHECK-LABEL: define{{.*}} swiftcc { <4 x float>, <4 x float> } @return_struct_vf81()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_vf81(<4 x float> %0, <4 x float> %1)
typedef struct struct_v1f3;
// CHECK-LABEL: define{{.*}} swiftcc { <2 x float>, float } @return_struct_v1f3()
// CHECK-LABEL: define{{.*}} swiftcc void @take_struct_v1f3(<2 x float> %0, float %1)