Skip to content

Commit 3211570

Browse files
committed
Re-enable float tests
1 parent bc92c00 commit 3211570

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

example/mini_core_hello_world.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,8 @@ fn main() {
275275
&mut (|| Some(0 as *const ())) as &mut dyn FnMut() -> Option<*const ()>;
276276

277277
let f = 1000.0;
278-
// FIXME(antoyo): doesn't work on m68k.
279-
#[cfg(target_arch="x86_64")]
280278
assert_eq!(f as u8, 255);
281279
let f2 = -1000.0;
282-
#[cfg(target_arch="x86_64")]
283280
assert_eq!(f2 as i8, -128);
284281
assert_eq!(f2 as u8, 0);
285282

example/std_example.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ fn main() {
4646
println!("{}", 2.3f32.max(1.0));
4747
println!("{}", 2.3f32.powi(2));
4848
println!("{}", 2.3f32.log2());
49-
// FIXME(antoyo): doesn't work on m68k.
50-
#[cfg(target_arch="x86_64")]
5149
assert_eq!(2.3f32.copysign(-1.0), -2.3f32);
5250
println!("{}", 2.3f32.powf(2.0));
5351

@@ -80,22 +78,15 @@ fn main() {
8078
// Check that all u/i128 <-> float casts work correctly.
8179
let houndred_u128 = 100u128;
8280
let houndred_i128 = 100i128;
83-
#[cfg(target_arch="x86_64")]
8481
let houndred_f32 = 100.0f32;
85-
#[cfg(target_arch="x86_64")]
8682
let houndred_f64 = 100.0f64;
8783
assert_eq!(houndred_u128 as f32, 100.0);
8884
assert_eq!(houndred_u128 as f64, 100.0);
89-
// FIXME(antoyo): doesn't work on m68k.
90-
#[cfg(target_arch="x86_64")]
9185
assert_eq!(houndred_f32 as u128, 100);
92-
#[cfg(target_arch="x86_64")]
9386
assert_eq!(houndred_f64 as u128, 100);
9487
assert_eq!(houndred_i128 as f32, 100.0);
9588
assert_eq!(houndred_i128 as f64, 100.0);
96-
#[cfg(target_arch="x86_64")]
9789
assert_eq!(houndred_f32 as i128, 100);
98-
#[cfg(target_arch="x86_64")]
9990
assert_eq!(houndred_f64 as i128, 100);
10091

10192
let _a = 1u32 << 2u8;

src/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
180180

181181
let tls_model = to_gcc_tls_mode(tcx.sess.tls_model());
182182

183+
// TODO(antoyo): set alignment on those types as well.
183184
let float_type = context.new_type::<f32>();
184185
let double_type = context.new_type::<f64>();
185186

src/type_.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
119119
}
120120

121121
fn type_f32(&self) -> Type<'gcc> {
122-
self.context.new_type::<f32>()
122+
self.float_type
123123
}
124124

125125
fn type_f64(&self) -> Type<'gcc> {
126-
self.context.new_type::<f64>()
126+
self.double_type
127127
}
128128

129129
fn type_func(&self, params: &[Type<'gcc>], return_type: Type<'gcc>) -> Type<'gcc> {

0 commit comments

Comments
 (0)