Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / arm-ha-alignstack.c
blob0fdf9c7792d282d069cfdec2409d89b64f73a0ff
1 // RUN: %clang_cc1 -triple armv7-eabi -emit-llvm %s -o - | \
2 // RUN: FileCheck %s --check-prefixes=CHECK,CHECK-SOFT
3 // RUN: %clang_cc1 -triple armv7-eabi -target-abi aapcs -mfloat-abi hard -emit-llvm %s -o - | \
4 // RUN: FileCheck %s --check-prefixes=CHECK,CHECK-HARD
5 // REQUIRES: arm-registered-target
7 // CHECK: %struct.S0 = type { [4 x float] }
8 // CHECK: %struct.S1 = type { [2 x float] }
9 // CHECK: %struct.S2 = type { [4 x float] }
10 // CHECK: %struct.D0 = type { [2 x double] }
11 // CHECK: %struct.D1 = type { [2 x double] }
12 // CHECK: %struct.D2 = type { [4 x double] }
14 typedef struct {
15 float v[4];
16 } S0;
18 float f0(S0 s) {
19 // CHECK-SOFT: define{{.*}} float @f0([4 x i32] %s.coerce)
20 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f0(%struct.S0 %s.coerce)
21 return s.v[0];
24 float f0call() {
25 S0 s = {0.0f, };
26 return f0(s);
27 // CHECK-SOFT: call float @f0([4 x i32]
28 // CHECK-HARD: call arm_aapcs_vfpcc float @f0(%struct.S0
31 typedef struct {
32 __attribute__((aligned(8))) float v[2];
33 } S1;
35 float f1(S1 s) {
36 // CHECK-SOFT: define{{.*}} float @f1([1 x i64]
37 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f1(%struct.S1 alignstack(8)
38 return s.v[0];
41 float f1call() {
42 S1 s = {0.0f, };
43 return f1(s);
44 // CHECK-SOFT: call float @f1([1 x i64
45 // CHECK-HARD: call arm_aapcs_vfpcc float @f1(%struct.S1 alignstack(8)
48 typedef struct {
49 __attribute__((aligned(16))) float v[4];
50 } S2;
52 float f2(S2 s) {
53 // CHECK-SOFT: define{{.*}} float @f2([2 x i64]
54 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f2(%struct.S2 alignstack(8)
55 return s.v[0];
58 float f2call() {
59 S2 s = {0.0f, };
60 return f2(s);
61 // CHECK-SOFT: call float @f2([2 x i64]
62 // CHECK-HARD: call arm_aapcs_vfpcc float @f2(%struct.S2 alignstack(8)
65 typedef struct {
66 double v[2];
67 } D0;
69 double g0(D0 d) {
70 // CHECK-SOFT: define{{.*}} double @g0([2 x i64]
71 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g0(%struct.D0 %d.coerce
72 return d.v[0];
75 double g0call() {
76 D0 d = {0.0, };
77 return g0(d);
78 // CHECK-SOFT: call double @g0([2 x i64]
79 // CHECK-HARD: call arm_aapcs_vfpcc double @g0(%struct.D0 %0
82 typedef struct {
83 __attribute__((aligned(16))) double v[2];
84 } D1;
86 double g1(D1 d) {
87 // CHECK-SOFT: define{{.*}} double @g1([2 x i64]
88 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g1(%struct.D1 alignstack(8)
89 return d.v[0];
92 double g1call() {
93 D1 d = {0.0, };
94 return g1(d);
95 // CHECK-SOFT: call double @g1([2 x i64]
96 // CHECK-HARD: call arm_aapcs_vfpcc double @g1(%struct.D1 alignstack(8)
99 typedef struct {
100 __attribute__((aligned(32))) double v[4];
101 } D2;
103 double g2(D2 d) {
104 // CHECK-SOFT: define{{.*}} double @g2([4 x i64]
105 // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g2(%struct.D2 alignstack(8)
106 return d.v[0];
109 double g2call() {
110 D2 d = {0.0, };
111 return g2(d);
112 // CHECK-SOFT: call double @g2([4 x i64]
113 // CHECK-HARD: call arm_aapcs_vfpcc double @g2(%struct.D2 alignstack(8)