Skip to content

Commit 7355738

Browse files
committed
Update tests.
1 parent 8fec6a9 commit 7355738

File tree

3 files changed

+98
-20
lines changed

3 files changed

+98
-20
lines changed

library/coretests/tests/num/flt2dec/mod.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -914,22 +914,22 @@ where
914914
);
915915

916916
// very large output
917-
assert_eq!(to_string(f, 0.0, Minus, 80000, false), format!("0.{:0>79999}e0", ""));
918-
assert_eq!(to_string(f, 1.0e1, Minus, 80000, false), format!("1.{:0>79999}e1", ""));
919-
assert_eq!(to_string(f, 1.0e0, Minus, 80000, false), format!("1.{:0>79999}e0", ""));
917+
assert_eq!(to_string(f, 0.0, Minus, 50000, false), format!("0.{:0>49999}e0", ""));
918+
assert_eq!(to_string(f, 1.0e1, Minus, 50000, false), format!("1.{:0>49999}e1", ""));
919+
assert_eq!(to_string(f, 1.0e0, Minus, 50000, false), format!("1.{:0>49999}e0", ""));
920920
assert_eq!(
921-
to_string(f, 1.0e-1, Minus, 80000, false),
921+
to_string(f, 1.0e-1, Minus, 50000, false),
922922
format!(
923-
"1.000000000000000055511151231257827021181583404541015625{:0>79945}\
923+
"1.000000000000000055511151231257827021181583404541015625{:0>49945}\
924924
e-1",
925925
""
926926
)
927927
);
928928
assert_eq!(
929-
to_string(f, 1.0e-20, Minus, 80000, false),
929+
to_string(f, 1.0e-20, Minus, 50000, false),
930930
format!(
931931
"9.999999999999999451532714542095716517295037027873924471077157760\
932-
66783064379706047475337982177734375{:0>79901}e-21",
932+
66783064379706047475337982177734375{:0>49901}e-21",
933933
""
934934
)
935935
);
@@ -1150,18 +1150,18 @@ where
11501150
);
11511151

11521152
// very large output
1153-
assert_eq!(to_string(f, 0.0, Minus, 80000), format!("0.{:0>80000}", ""));
1154-
assert_eq!(to_string(f, 1.0e1, Minus, 80000), format!("10.{:0>80000}", ""));
1155-
assert_eq!(to_string(f, 1.0e0, Minus, 80000), format!("1.{:0>80000}", ""));
1153+
assert_eq!(to_string(f, 0.0, Minus, 50000), format!("0.{:0>50000}", ""));
1154+
assert_eq!(to_string(f, 1.0e1, Minus, 50000), format!("10.{:0>50000}", ""));
1155+
assert_eq!(to_string(f, 1.0e0, Minus, 50000), format!("1.{:0>50000}", ""));
11561156
assert_eq!(
1157-
to_string(f, 1.0e-1, Minus, 80000),
1158-
format!("0.1000000000000000055511151231257827021181583404541015625{:0>79945}", "")
1157+
to_string(f, 1.0e-1, Minus, 50000),
1158+
format!("0.1000000000000000055511151231257827021181583404541015625{:0>49945}", "")
11591159
);
11601160
assert_eq!(
1161-
to_string(f, 1.0e-20, Minus, 80000),
1161+
to_string(f, 1.0e-20, Minus, 50000),
11621162
format!(
11631163
"0.0000000000000000000099999999999999994515327145420957165172950370\
1164-
2787392447107715776066783064379706047475337982177734375{:0>79881}",
1164+
2787392447107715776066783064379706047475337982177734375{:0>49881}",
11651165
""
11661166
)
11671167
);

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff

+42-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
debug precision => _8;
3030
let _8: usize;
3131
scope 5 (inlined Formatter::<'_>::precision) {
32+
let mut _22: std::option::Option<u16>;
33+
scope 6 (inlined Option::<u16>::map::<usize, {closure@Formatter<'_>::precision::{closure#0}}>) {
34+
let mut _23: isize;
35+
let _24: u16;
36+
let mut _25: usize;
37+
scope 7 {
38+
scope 8 (inlined Formatter::<'_>::precision::{closure#0}) {
39+
}
40+
}
41+
}
3242
}
3343
}
3444
}
@@ -65,9 +75,12 @@
6575

6676
bb3: {
6777
StorageLive(_6);
68-
_6 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
69-
_7 = discriminant(_6);
70-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
78+
StorageLive(_24);
79+
StorageLive(_22);
80+
_22 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<u16>);
81+
StorageLive(_23);
82+
_23 = discriminant(_22);
83+
switchInt(move _23) -> [0: bb11, 1: bb12, otherwise: bb10];
7184
}
7285

7386
bb4: {
@@ -135,7 +148,33 @@
135148
}
136149

137150
bb9: {
151+
StorageDead(_23);
152+
StorageDead(_22);
153+
StorageDead(_24);
154+
_7 = discriminant(_6);
155+
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb10];
156+
}
157+
158+
bb10: {
138159
unreachable;
139160
}
161+
162+
bb11: {
163+
_6 = const Option::<usize>::None;
164+
goto -> bb9;
165+
}
166+
167+
bb12: {
168+
_24 = move ((_22 as Some).0: u16);
169+
StorageLive(_25);
170+
_25 = copy _24 as usize (IntToInt);
171+
_6 = Option::<usize>::Some(move _25);
172+
StorageDead(_25);
173+
goto -> bb9;
174+
}
175+
}
176+
177+
ALLOC0 (size: 8, align: 4) {
178+
00 00 00 00 __ __ __ __ │ ....░░░░
140179
}
141180

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff

+42-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
debug precision => _8;
3030
let _8: usize;
3131
scope 5 (inlined Formatter::<'_>::precision) {
32+
let mut _22: std::option::Option<u16>;
33+
scope 6 (inlined Option::<u16>::map::<usize, {closure@Formatter<'_>::precision::{closure#0}}>) {
34+
let mut _23: isize;
35+
let _24: u16;
36+
let mut _25: usize;
37+
scope 7 {
38+
scope 8 (inlined Formatter::<'_>::precision::{closure#0}) {
39+
}
40+
}
41+
}
3242
}
3343
}
3444
}
@@ -65,9 +75,12 @@
6575

6676
bb3: {
6777
StorageLive(_6);
68-
_6 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
69-
_7 = discriminant(_6);
70-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
78+
StorageLive(_24);
79+
StorageLive(_22);
80+
_22 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<u16>);
81+
StorageLive(_23);
82+
_23 = discriminant(_22);
83+
switchInt(move _23) -> [0: bb11, 1: bb12, otherwise: bb10];
7184
}
7285

7386
bb4: {
@@ -135,7 +148,33 @@
135148
}
136149

137150
bb9: {
151+
StorageDead(_23);
152+
StorageDead(_22);
153+
StorageDead(_24);
154+
_7 = discriminant(_6);
155+
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb10];
156+
}
157+
158+
bb10: {
138159
unreachable;
139160
}
161+
162+
bb11: {
163+
_6 = const Option::<usize>::None;
164+
goto -> bb9;
165+
}
166+
167+
bb12: {
168+
_24 = move ((_22 as Some).0: u16);
169+
StorageLive(_25);
170+
_25 = copy _24 as usize (IntToInt);
171+
_6 = Option::<usize>::Some(move _25);
172+
StorageDead(_25);
173+
goto -> bb9;
174+
}
175+
}
176+
177+
ALLOC0 (size: 8, align: 4) {
178+
00 00 00 00 __ __ __ __ │ ....░░░░
140179
}
141180

0 commit comments

Comments
 (0)