From 6146714112e76e372afb45b354deca6088888fbb Mon Sep 17 00:00:00 2001 From: Chunmyong Park Date: Wed, 10 Jun 2020 10:47:32 +0000 Subject: [PATCH] Fix example code --- examples/asmgen/float2.ir | 2 +- examples/c/float2.c | 2 +- examples/ir0/float2.ir | 2 +- examples/ir1/float2.ir | 2 +- examples/ir2/float2.ir | 2 +- examples/ir3/float2.ir | 2 +- examples/ir4/float2.ir | 2 +- src/tests.rs | 7 ------- 8 files changed, 7 insertions(+), 14 deletions(-) diff --git a/examples/asmgen/float2.ir b/examples/asmgen/float2.ir index 3547eae..28c12f9 100644 --- a/examples/asmgen/float2.ir +++ b/examples/asmgen/float2.ir @@ -7886,7 +7886,7 @@ block b0: %b0:i20:f64 = minus 0.8836803984453947:f64 %b0:i21:f32 = typecast %b0:i20:f64 to f32 %b0:i22:unit = store %b0:i21:f32 %l9:*f32 - %b0:i23:unit = store 0.02298282564015198:f64 %l10:*f64 + %b0:i23:unit = store 1.022982825640152:f64 %l10:*f64 %b0:i24:f32 = typecast 0.768435276037987:f64 to f32 %b0:i25:unit = store %b0:i24:f32 %l11:*f32 %b0:i26:f64 = typecast 2.0350472927093506:f32 to f64 diff --git a/examples/c/float2.c b/examples/c/float2.c index 95a679a..eb3ed77 100644 --- a/examples/c/float2.c +++ b/examples/c/float2.c @@ -1706,7 +1706,7 @@ double func_53() double h = 0.5573622064055939; double i = -0.24231501222959176; float j = -0.8836803984453947; - double k = 0.02298282564015198; + double k = 1.02298282564015198; float l = 0.768435276037987; double m = 2.0350472413013128f; double n = -1.3339335818980034; diff --git a/examples/ir0/float2.ir b/examples/ir0/float2.ir index 3547eae..28c12f9 100644 --- a/examples/ir0/float2.ir +++ b/examples/ir0/float2.ir @@ -7886,7 +7886,7 @@ block b0: %b0:i20:f64 = minus 0.8836803984453947:f64 %b0:i21:f32 = typecast %b0:i20:f64 to f32 %b0:i22:unit = store %b0:i21:f32 %l9:*f32 - %b0:i23:unit = store 0.02298282564015198:f64 %l10:*f64 + %b0:i23:unit = store 1.022982825640152:f64 %l10:*f64 %b0:i24:f32 = typecast 0.768435276037987:f64 to f32 %b0:i25:unit = store %b0:i24:f32 %l11:*f32 %b0:i26:f64 = typecast 2.0350472927093506:f32 to f64 diff --git a/examples/ir1/float2.ir b/examples/ir1/float2.ir index 1cb1fda..c558c6d 100644 --- a/examples/ir1/float2.ir +++ b/examples/ir1/float2.ir @@ -7739,7 +7739,7 @@ block b0: %b0:i20:f64 = minus 0.8836803984453947:f64 %b0:i21:f32 = typecast %b0:i20:f64 to f32 %b0:i22:unit = store %b0:i21:f32 %l9:*f32 - %b0:i23:unit = store 0.02298282564015198:f64 %l10:*f64 + %b0:i23:unit = store 1.022982825640152:f64 %l10:*f64 %b0:i24:f32 = typecast 0.768435276037987:f64 to f32 %b0:i25:unit = store %b0:i24:f32 %l11:*f32 %b0:i26:f64 = typecast 2.0350472927093506:f32 to f64 diff --git a/examples/ir2/float2.ir b/examples/ir2/float2.ir index 2d8bc05..9a33786 100644 --- a/examples/ir2/float2.ir +++ b/examples/ir2/float2.ir @@ -7818,7 +7818,7 @@ block b0: %b0:i99:f64 = sub %b0:i18:f64 %b0:i98:f64 %b0:i100:f64 = typecast %b0:i21:f32 to f64 %b0:i101:f64 = add %b0:i100:f64 %b0:i99:f64 - %b0:i102:f64 = div 0.02298282564015198:f64 %b0:i101:f64 + %b0:i102:f64 = div 1.022982825640152:f64 %b0:i101:f64 %b0:i103:f64 = typecast %b0:i24:f32 to f64 %b0:i104:f64 = div %b0:i103:f64 %b0:i102:f64 %b0:i105:f64 = div %b0:i26:f64 %b0:i104:f64 diff --git a/examples/ir3/float2.ir b/examples/ir3/float2.ir index 3e459fc..67f7f86 100644 --- a/examples/ir3/float2.ir +++ b/examples/ir3/float2.ir @@ -3818,7 +3818,7 @@ block b0: %b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64 %b0:i46:f64 = typecast %b0:i12:f32 to f64 %b0:i47:f64 = add %b0:i46:f64 %b0:i45:f64 - %b0:i48:f64 = div 0.02298282564015198:f64 %b0:i47:f64 + %b0:i48:f64 = div 1.022982825640152:f64 %b0:i47:f64 %b0:i49:f64 = typecast %b0:i13:f32 to f64 %b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64 %b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64 diff --git a/examples/ir4/float2.ir b/examples/ir4/float2.ir index 3e459fc..67f7f86 100644 --- a/examples/ir4/float2.ir +++ b/examples/ir4/float2.ir @@ -3818,7 +3818,7 @@ block b0: %b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64 %b0:i46:f64 = typecast %b0:i12:f32 to f64 %b0:i47:f64 = add %b0:i46:f64 %b0:i45:f64 - %b0:i48:f64 = div 0.02298282564015198:f64 %b0:i47:f64 + %b0:i48:f64 = div 1.022982825640152:f64 %b0:i47:f64 %b0:i49:f64 = typecast %b0:i13:f32 to f64 %b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64 %b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64 diff --git a/src/tests.rs b/src/tests.rs index 1b39533..12c5eb8 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -303,13 +303,6 @@ pub fn test_asmgen(path: &Path) { // TODO: test all the way down to assembly pub fn test_end_to_end(path: &Path) { - // TODO: delete ignore list in the future - let ignore_list = vec!["examples/c/float2.c"]; - if ignore_list.contains(&path.to_str().expect("`path` must be transformed to `&str`")) { - println!("skip test"); - return; - } - // Check if the file has .c extension assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c"))); let unit = c::Parse::default()