mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Fix example code
This commit is contained in:
@@ -7886,7 +7886,7 @@ block b0:
|
|||||||
%b0:i20:f64 = minus 0.8836803984453947:f64
|
%b0:i20:f64 = minus 0.8836803984453947:f64
|
||||||
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
||||||
%b0:i22:unit = store %b0:i21:f32 %l9:*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:i24:f32 = typecast 0.768435276037987:f64 to f32
|
||||||
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
||||||
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
||||||
|
|||||||
@@ -1706,7 +1706,7 @@ double func_53()
|
|||||||
double h = 0.5573622064055939;
|
double h = 0.5573622064055939;
|
||||||
double i = -0.24231501222959176;
|
double i = -0.24231501222959176;
|
||||||
float j = -0.8836803984453947;
|
float j = -0.8836803984453947;
|
||||||
double k = 0.02298282564015198;
|
double k = 1.02298282564015198;
|
||||||
float l = 0.768435276037987;
|
float l = 0.768435276037987;
|
||||||
double m = 2.0350472413013128f;
|
double m = 2.0350472413013128f;
|
||||||
double n = -1.3339335818980034;
|
double n = -1.3339335818980034;
|
||||||
|
|||||||
@@ -7886,7 +7886,7 @@ block b0:
|
|||||||
%b0:i20:f64 = minus 0.8836803984453947:f64
|
%b0:i20:f64 = minus 0.8836803984453947:f64
|
||||||
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
||||||
%b0:i22:unit = store %b0:i21:f32 %l9:*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:i24:f32 = typecast 0.768435276037987:f64 to f32
|
||||||
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
||||||
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
||||||
|
|||||||
@@ -7739,7 +7739,7 @@ block b0:
|
|||||||
%b0:i20:f64 = minus 0.8836803984453947:f64
|
%b0:i20:f64 = minus 0.8836803984453947:f64
|
||||||
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
%b0:i21:f32 = typecast %b0:i20:f64 to f32
|
||||||
%b0:i22:unit = store %b0:i21:f32 %l9:*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:i24:f32 = typecast 0.768435276037987:f64 to f32
|
||||||
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
%b0:i25:unit = store %b0:i24:f32 %l11:*f32
|
||||||
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
%b0:i26:f64 = typecast 2.0350472927093506:f32 to f64
|
||||||
|
|||||||
@@ -7818,7 +7818,7 @@ block b0:
|
|||||||
%b0:i99:f64 = sub %b0:i18:f64 %b0:i98:f64
|
%b0:i99:f64 = sub %b0:i18:f64 %b0:i98:f64
|
||||||
%b0:i100:f64 = typecast %b0:i21:f32 to f64
|
%b0:i100:f64 = typecast %b0:i21:f32 to f64
|
||||||
%b0:i101:f64 = add %b0:i100:f64 %b0:i99: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:i103:f64 = typecast %b0:i24:f32 to f64
|
||||||
%b0:i104:f64 = div %b0:i103:f64 %b0:i102:f64
|
%b0:i104:f64 = div %b0:i103:f64 %b0:i102:f64
|
||||||
%b0:i105:f64 = div %b0:i26:f64 %b0:i104:f64
|
%b0:i105:f64 = div %b0:i26:f64 %b0:i104:f64
|
||||||
|
|||||||
@@ -3818,7 +3818,7 @@ block b0:
|
|||||||
%b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64
|
%b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64
|
||||||
%b0:i46:f64 = typecast %b0:i12:f32 to f64
|
%b0:i46:f64 = typecast %b0:i12:f32 to f64
|
||||||
%b0:i47:f64 = add %b0:i46:f64 %b0:i45: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:i49:f64 = typecast %b0:i13:f32 to f64
|
||||||
%b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64
|
%b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64
|
||||||
%b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64
|
%b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64
|
||||||
|
|||||||
@@ -3818,7 +3818,7 @@ block b0:
|
|||||||
%b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64
|
%b0:i45:f64 = sub %b0:i10:f64 %b0:i44:f64
|
||||||
%b0:i46:f64 = typecast %b0:i12:f32 to f64
|
%b0:i46:f64 = typecast %b0:i12:f32 to f64
|
||||||
%b0:i47:f64 = add %b0:i46:f64 %b0:i45: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:i49:f64 = typecast %b0:i13:f32 to f64
|
||||||
%b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64
|
%b0:i50:f64 = div %b0:i49:f64 %b0:i48:f64
|
||||||
%b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64
|
%b0:i51:f64 = div %b0:i14:f64 %b0:i50:f64
|
||||||
|
|||||||
@@ -303,13 +303,6 @@ pub fn test_asmgen(path: &Path) {
|
|||||||
|
|
||||||
// TODO: test all the way down to assembly
|
// TODO: test all the way down to assembly
|
||||||
pub fn test_end_to_end(path: &Path) {
|
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
|
// Check if the file has .c extension
|
||||||
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
||||||
let unit = c::Parse::default()
|
let unit = c::Parse::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user