Skip to content

Commit 69c0427

Browse files
committed
Fix -stop-after lambda (#3128)
1 parent 604ea6a commit 69c0427

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

driver/optcompile.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ let compile i typed ~transl_style ~unix ~pipeline =
4545
|> print_if i.ppf_dump Clflags.dump_lambda Printlambda.program
4646
|> Compiler_hooks.execute_and_pipe Compiler_hooks.Lambda
4747
|> (fun program ->
48+
if Clflags.(should_stop_after Compiler_pass.Lambda) then () else
4849
Asmgen.compile_implementation
4950
unix
5051
~pipeline
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
File "stop_after_lambda_warn_error.ml", line 12, characters 5-12:
2+
12 | let[@inlined] f x = x
3+
^^^^^^^
4+
Error (warning 53 [misplaced-attribute]): the "inlined" attribute cannot appear in this context
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(* TEST
2+
setup-ocamlopt.byte-build-env;
3+
flags = "-stop-after lambda -warn-error +53";
4+
ocamlopt_byte_exit_status = "2";
5+
ocamlopt.byte;
6+
check-ocamlopt.byte-output;
7+
*)
8+
9+
(* This should have exit code 2, because we've set -warn-error for a warning
10+
that is issued. *)
11+
12+
let[@inlined] f x = x

0 commit comments

Comments
 (0)