Skip to content

Commit 4b4e6d9

Browse files
committed
Remove return types and combine codegen tests.
1 parent 10baf44 commit 4b4e6d9

File tree

5 files changed

+146
-158
lines changed

5 files changed

+146
-158
lines changed

tests/codegen/float/algebraic.rs

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
// Verify that algebraic intrinsics generate the correct LLVM calls
2+
3+
#![crate_type = "lib"]
4+
#![feature(f16)]
5+
#![feature(f128)]
6+
#![feature(float_algebraic)]
7+
8+
// CHECK-LABEL: @f16_algebraic_add
9+
#[no_mangle]
10+
pub fn f16_algebraic_add(a: f16, b: f16) -> f16 {
11+
// CHECK: fadd reassoc nsz arcp contract half {{(%a, %b)|(%b, %a)}}
12+
a.algebraic_add(b)
13+
}
14+
15+
// CHECK-LABEL: @f16_algebraic_sub
16+
#[no_mangle]
17+
pub fn f16_algebraic_sub(a: f16, b: f16) -> f16 {
18+
// CHECK: fsub reassoc nsz arcp contract half %a, %b
19+
a.algebraic_sub(b)
20+
}
21+
22+
// CHECK-LABEL: @f16_algebraic_mul
23+
#[no_mangle]
24+
pub fn f16_algebraic_mul(a: f16, b: f16) -> f16 {
25+
// CHECK: fmul reassoc nsz arcp contract half {{(%a, %b)|(%b, %a)}}
26+
a.algebraic_mul(b)
27+
}
28+
29+
// CHECK-LABEL: @f16_algebraic_div
30+
#[no_mangle]
31+
pub fn f16_algebraic_div(a: f16, b: f16) -> f16 {
32+
// CHECK: fdiv reassoc nsz arcp contract half %a, %b
33+
a.algebraic_div(b)
34+
}
35+
36+
// CHECK-LABEL: @f16_algebraic_rem
37+
#[no_mangle]
38+
pub fn f16_algebraic_rem(a: f16, b: f16) -> f16 {
39+
// CHECK: frem reassoc nsz arcp contract half %a, %b
40+
a.algebraic_rem(b)
41+
}
42+
43+
// CHECK-LABEL: @f32_algebraic_add
44+
#[no_mangle]
45+
pub fn f32_algebraic_add(a: f32, b: f32) -> f32 {
46+
// CHECK: fadd reassoc nsz arcp contract float {{(%a, %b)|(%b, %a)}}
47+
a.algebraic_add(b)
48+
}
49+
50+
// CHECK-LABEL: @f32_algebraic_sub
51+
#[no_mangle]
52+
pub fn f32_algebraic_sub(a: f32, b: f32) -> f32 {
53+
// CHECK: fsub reassoc nsz arcp contract float %a, %b
54+
a.algebraic_sub(b)
55+
}
56+
57+
// CHECK-LABEL: @f32_algebraic_mul
58+
#[no_mangle]
59+
pub fn f32_algebraic_mul(a: f32, b: f32) -> f32 {
60+
// CHECK: fmul reassoc nsz arcp contract float {{(%a, %b)|(%b, %a)}}
61+
a.algebraic_mul(b)
62+
}
63+
64+
// CHECK-LABEL: @f32_algebraic_div
65+
#[no_mangle]
66+
pub fn f32_algebraic_div(a: f32, b: f32) -> f32 {
67+
// CHECK: fdiv reassoc nsz arcp contract float %a, %b
68+
a.algebraic_div(b)
69+
}
70+
71+
// CHECK-LABEL: @f32_algebraic_rem
72+
#[no_mangle]
73+
pub fn f32_algebraic_rem(a: f32, b: f32) -> f32 {
74+
// CHECK: frem reassoc nsz arcp contract float %a, %b
75+
a.algebraic_rem(b)
76+
}
77+
78+
// CHECK-LABEL: @f64_algebraic_add
79+
#[no_mangle]
80+
pub fn f64_algebraic_add(a: f64, b: f64) -> f64 {
81+
// CHECK: fadd reassoc nsz arcp contract double {{(%a, %b)|(%b, %a)}}
82+
a.algebraic_add(b)
83+
}
84+
85+
// CHECK-LABEL: @f64_algebraic_sub
86+
#[no_mangle]
87+
pub fn f64_algebraic_sub(a: f64, b: f64) -> f64 {
88+
// CHECK: fsub reassoc nsz arcp contract double %a, %b
89+
a.algebraic_sub(b)
90+
}
91+
92+
// CHECK-LABEL: @f64_algebraic_mul
93+
#[no_mangle]
94+
pub fn f64_algebraic_mul(a: f64, b: f64) -> f64 {
95+
// CHECK: fmul reassoc nsz arcp contract double {{(%a, %b)|(%b, %a)}}
96+
a.algebraic_mul(b)
97+
}
98+
99+
// CHECK-LABEL: @f64_algebraic_div
100+
#[no_mangle]
101+
pub fn f64_algebraic_div(a: f64, b: f64) -> f64 {
102+
// CHECK: fdiv reassoc nsz arcp contract double %a, %b
103+
a.algebraic_div(b)
104+
}
105+
106+
// CHECK-LABEL: @f64_algebraic_rem
107+
#[no_mangle]
108+
pub fn f64_algebraic_rem(a: f64, b: f64) -> f64 {
109+
// CHECK: frem reassoc nsz arcp contract double %a, %b
110+
a.algebraic_rem(b)
111+
}
112+
113+
// CHECK-LABEL: @f128_algebraic_add
114+
#[no_mangle]
115+
pub fn f128_algebraic_add(a: f128, b: f128) -> f128 {
116+
// CHECK: fadd reassoc nsz arcp contract fp128 {{(%a, %b)|(%b, %a)}}
117+
a.algebraic_add(b)
118+
}
119+
120+
// CHECK-LABEL: @f128_algebraic_sub
121+
#[no_mangle]
122+
pub fn f128_algebraic_sub(a: f128, b: f128) -> f128 {
123+
// CHECK: fsub reassoc nsz arcp contract fp128 %a, %b
124+
a.algebraic_sub(b)
125+
}
126+
127+
// CHECK-LABEL: @f128_algebraic_mul
128+
#[no_mangle]
129+
pub fn f128_algebraic_mul(a: f128, b: f128) -> f128 {
130+
// CHECK: fmul reassoc nsz arcp contract fp128 {{(%a, %b)|(%b, %a)}}
131+
a.algebraic_mul(b)
132+
}
133+
134+
// CHECK-LABEL: @f128_algebraic_div
135+
#[no_mangle]
136+
pub fn f128_algebraic_div(a: f128, b: f128) -> f128 {
137+
// CHECK: fdiv reassoc nsz arcp contract fp128 %a, %b
138+
a.algebraic_div(b)
139+
}
140+
141+
// CHECK-LABEL: @f128_algebraic_rem
142+
#[no_mangle]
143+
pub fn f128_algebraic_rem(a: f128, b: f128) -> f128 {
144+
// CHECK: frem reassoc nsz arcp contract fp128 %a, %b
145+
a.algebraic_rem(b)
146+
}

tests/codegen/float/f128-algebraic.rs

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/codegen/float/f16-algebraic.rs

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/codegen/float/f32-algebraic.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/codegen/float/f64-algebraic.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)