Skip to content

Commit df89de2

Browse files
committed
Test atomic volatile as well.
1 parent 7abe41b commit df89de2

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

clang/test/CodeGen/SystemZ/atomic_fp_load_store.c

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,83 @@ long double fun11(_Atomic long double *Src) {
8282
// CHECK: %atomic-load = load atomic fp128, ptr %Src seq_cst, align 16
8383
return *Src;
8484
}
85+
86+
//// Same, but with 'volatile' as well:
87+
88+
_Atomic volatile float Af_vol;
89+
_Atomic volatile double Ad_vol;
90+
_Atomic volatile long double Ald_vol;
91+
92+
//// Atomic volatile stores of floating point values.
93+
void fun0_vol(float Arg) {
94+
// CHECK-LABEL: @fun0_vol
95+
// CHECK: store atomic volatile float %Arg, ptr @Af_vol seq_cst, align 4
96+
Af_vol = Arg;
97+
}
98+
99+
void fun1_vol(double Arg) {
100+
// CHECK-LABEL: @fun1_vol
101+
// CHECK: store atomic volatile double %Arg, ptr @Ad_vol seq_cst, align 8
102+
Ad_vol = Arg;
103+
}
104+
105+
void fun2_vol(long double Arg) {
106+
// CHECK-LABEL: @fun2_vol
107+
// CHECK: store atomic volatile fp128 %Arg, ptr @Ald_vol seq_cst, align 16
108+
Ald_vol = Arg;
109+
}
110+
111+
void fun3_vol(_Atomic volatile float *Dst, float Arg) {
112+
// CHECK-LABEL: @fun3_vol
113+
// CHECK: store atomic volatile float %Arg, ptr %Dst seq_cst, align 4
114+
*Dst = Arg;
115+
}
116+
117+
void fun4_vol(_Atomic volatile double *Dst, double Arg) {
118+
// CHECK-LABEL: @fun4_vol
119+
// CHECK: store atomic volatile double %Arg, ptr %Dst seq_cst, align 8
120+
*Dst = Arg;
121+
}
122+
123+
void fun5_vol(_Atomic volatile long double *Dst, long double Arg) {
124+
// CHECK-LABEL: @fun5_vol
125+
// CHECK: store atomic volatile fp128 %Arg, ptr %Dst seq_cst, align 16
126+
*Dst = Arg;
127+
}
128+
129+
//// Atomic volatile loads of floating point values.
130+
float fun6_vol() {
131+
// CHECK-LABEL: @fun6_vol
132+
// CHECK: %atomic-load = load atomic volatile float, ptr @Af_vol seq_cst, align 4
133+
return Af_vol;
134+
}
135+
136+
float fun7_vol() {
137+
// CHECK-LABEL: @fun7_vol
138+
// CHECK: %atomic-load = load atomic volatile double, ptr @Ad_vol seq_cst, align 8
139+
return Ad_vol;
140+
}
141+
142+
float fun8_vol() {
143+
// CHECK-LABEL: @fun8_vol
144+
// CHECK: %atomic-load = load atomic volatile fp128, ptr @Ald_vol seq_cst, align 16
145+
return Ald_vol;
146+
}
147+
148+
float fun9_vol(_Atomic volatile float *Src) {
149+
// CHECK-LABEL: @fun9_vol
150+
// CHECK: %atomic-load = load atomic volatile float, ptr %Src seq_cst, align 4
151+
return *Src;
152+
}
153+
154+
double fun10_vol(_Atomic volatile double *Src) {
155+
// CHECK-LABEL: @fun10_vol
156+
// CHECK: %atomic-load = load atomic volatile double, ptr %Src seq_cst, align 8
157+
return *Src;
158+
}
159+
160+
long double fun11_vol(_Atomic volatile long double *Src) {
161+
// CHECK-LABEL: @fun11_vol
162+
// CHECK: %atomic-load = load atomic volatile fp128, ptr %Src seq_cst, align 16
163+
return *Src;
164+
}

0 commit comments

Comments
 (0)