Skip to content

Commit 1f29da6

Browse files
committed
Test: expose global DCE issue with the toplevel
1 parent 679bb51 commit 1f29da6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let () =
22
let content = {|
33
let () = print_endline "hello";;
4+
1+1;;
45
1+;;
56
Missing_module.f;;
67
|} in
@@ -12,10 +13,10 @@ Missing_module.f;;
1213
try
1314
Location.reset ();
1415
let phr = !Toploop.parse_toplevel_phrase lexbuf in
15-
if not (Toploop.execute_phrase true Format.std_formatter phr) then raise Exit
16+
let res = Toploop.execute_phrase true Format.std_formatter phr in
17+
flush_all ();
18+
if not res then raise Exit
1619
with
17-
| End_of_file ->
18-
flush_all ();
19-
exit 0
20+
| End_of_file -> exit 0
2021
| x -> Location.report_exception Format.std_formatter x
2122
done
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
hello
2-
Line 3, characters 2-4:
2+
Line 4, characters 2-4:
33
Error: Syntax error
4-
Line 4, characters 0-16:
4+
Line 5, characters 0-16:
55
Error: Unbound module Missing_module

0 commit comments

Comments
 (0)