comparison clang/test/CodeGen/arm-homogenous.c @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 0572611fdcc8
children c4bab56944e8
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
25 // CHECK: declare arm_aapcs_vfpcc void @takes_union_with_first_floats([4 x i32]) 25 // CHECK: declare arm_aapcs_vfpcc void @takes_union_with_first_floats([4 x i32])
26 26
27 void test_return_union_with_first_floats(void) { 27 void test_return_union_with_first_floats(void) {
28 g_u_f = returns_union_with_first_floats(); 28 g_u_f = returns_union_with_first_floats();
29 } 29 }
30 // CHECK: declare arm_aapcs_vfpcc void @returns_union_with_first_floats(%union.union_with_first_floats* sret align 4) 30 // CHECK: declare arm_aapcs_vfpcc void @returns_union_with_first_floats(%union.union_with_first_floats* sret(%union.union_with_first_floats) align 4)
31 31
32 /* This is not a homogenous aggregate - fundamental types are different */ 32 /* This is not a homogenous aggregate - fundamental types are different */
33 typedef union { 33 typedef union {
34 uint32_t i[4]; 34 uint32_t i[4];
35 float f[4]; 35 float f[4];
45 // CHECK: declare arm_aapcs_vfpcc void @takes_union_with_non_first_floats([4 x i32]) 45 // CHECK: declare arm_aapcs_vfpcc void @takes_union_with_non_first_floats([4 x i32])
46 46
47 void test_return_union_with_non_first_floats(void) { 47 void test_return_union_with_non_first_floats(void) {
48 g_u_nf_f = returns_union_with_non_first_floats(); 48 g_u_nf_f = returns_union_with_non_first_floats();
49 } 49 }
50 // CHECK: declare arm_aapcs_vfpcc void @returns_union_with_non_first_floats(%union.union_with_non_first_floats* sret align 4) 50 // CHECK: declare arm_aapcs_vfpcc void @returns_union_with_non_first_floats(%union.union_with_non_first_floats* sret(%union.union_with_non_first_floats) align 4)
51 51
52 /* This is not a homogenous aggregate - fundamental types are different */ 52 /* This is not a homogenous aggregate - fundamental types are different */
53 typedef struct { 53 typedef struct {
54 float a; 54 float a;
55 union_with_first_floats b; 55 union_with_first_floats b;
65 // CHECK: declare arm_aapcs_vfpcc void @takes_struct_with_union_with_first_floats([5 x i32]) 65 // CHECK: declare arm_aapcs_vfpcc void @takes_struct_with_union_with_first_floats([5 x i32])
66 66
67 void test_return_struct_with_union_with_first_floats(void) { 67 void test_return_struct_with_union_with_first_floats(void) {
68 g_s_f = returns_struct_with_union_with_first_floats(); 68 g_s_f = returns_struct_with_union_with_first_floats();
69 } 69 }
70 // CHECK: declare arm_aapcs_vfpcc void @returns_struct_with_union_with_first_floats(%struct.struct_with_union_with_first_floats* sret align 4) 70 // CHECK: declare arm_aapcs_vfpcc void @returns_struct_with_union_with_first_floats(%struct.struct_with_union_with_first_floats* sret(%struct.struct_with_union_with_first_floats) align 4)
71 71
72 /* This is not a homogenous aggregate - fundamental types are different */ 72 /* This is not a homogenous aggregate - fundamental types are different */
73 typedef struct { 73 typedef struct {
74 float a; 74 float a;
75 union_with_non_first_floats b; 75 union_with_non_first_floats b;
85 // CHECK: declare arm_aapcs_vfpcc void @takes_struct_with_union_with_non_first_floats([5 x i32]) 85 // CHECK: declare arm_aapcs_vfpcc void @takes_struct_with_union_with_non_first_floats([5 x i32])
86 86
87 void test_return_struct_with_union_with_non_first_floats(void) { 87 void test_return_struct_with_union_with_non_first_floats(void) {
88 g_s_nf_f = returns_struct_with_union_with_non_first_floats(); 88 g_s_nf_f = returns_struct_with_union_with_non_first_floats();
89 } 89 }
90 // CHECK: declare arm_aapcs_vfpcc void @returns_struct_with_union_with_non_first_floats(%struct.struct_with_union_with_non_first_floats* sret align 4) 90 // CHECK: declare arm_aapcs_vfpcc void @returns_struct_with_union_with_non_first_floats(%struct.struct_with_union_with_non_first_floats* sret(%struct.struct_with_union_with_non_first_floats) align 4)
91 91
92 /* Plain array is not a homogenous aggregate */ 92 /* Plain array is not a homogenous aggregate */
93 extern void takes_array_of_floats(float a[4]); 93 extern void takes_array_of_floats(float a[4]);
94 void test_array_of_floats(void) { 94 void test_array_of_floats(void) {
95 float a[4] = {1.0, 2.0, 3.0, 4.0}; 95 float a[4] = {1.0, 2.0, 3.0, 4.0};
221 struct_of_double_and_long_double g_dld; 221 struct_of_double_and_long_double g_dld;
222 222
223 struct_of_double_and_long_double test_struct_of_double_and_long_double(void) { 223 struct_of_double_and_long_double test_struct_of_double_and_long_double(void) {
224 return g_dld; 224 return g_dld;
225 } 225 }
226 // CHECK: define arm_aapcs_vfpcc %struct.struct_of_double_and_long_double @test_struct_of_double_and_long_double() 226 // CHECK: define{{.*}} arm_aapcs_vfpcc %struct.struct_of_double_and_long_double @test_struct_of_double_and_long_double()
227 227
228 // FIXME: Tests necessary: 228 // FIXME: Tests necessary:
229 // - Vectors 229 // - Vectors
230 // - C++ stuff 230 // - C++ stuff