File tree Expand file tree Collapse file tree 4 files changed +32
-0
lines changed Expand file tree Collapse file tree 4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 578
578
(enabled_if (= % {context_name} " main" ))
579
579
(deps test_zero_alloc_opt2.ml)
580
580
(action (run % {bin : ocamlopt.opt} % {deps} - g - c - zero- alloc- check opt - dcse - dcheckmach - dump- into- file - O3)))
581
+
582
+ (rule
583
+ (enabled_if (= % {context_name} " main" ))
584
+ (targets test_misplaced_attr.output.corrected)
585
+ (deps (:ml test_misplaced_attr.ml) filter.sh)
586
+ (action
587
+ (with- outputs- to test_misplaced_attr.output.corrected
588
+ (pipe- outputs
589
+ (with- accepted- exit- codes 0
590
+ (run % {bin : ocamlopt.opt} % {ml} - g - color never - error- style short - c
591
+ - zero- alloc- check default - checkmach- details- cutoff 20 - O3))
592
+ (run " ./filter.sh" )
593
+ ))))
594
+
595
+ (rule
596
+ (alias runtest)
597
+ (enabled_if (= % {context_name} " main" ))
598
+ (deps test_misplaced_attr.output test_misplaced_attr.output.corrected)
599
+ (action (diff test_misplaced_attr.output test_misplaced_attr.output.corrected)))
Original file line number Diff line number Diff line change @@ -124,4 +124,5 @@ let () =
124
124
print_test_expected_output ~extra_flags: " -zero-alloc-check opt" ~cutoff: default_cutoff ~flambda_only: true ~extra_dep: None ~exit_code: 2 " fail23" ;
125
125
print_test ~extra_flags: " -zero-alloc-check opt" ~flambda_only: false " test_zero_alloc_opt1.ml" ;
126
126
print_test ~extra_flags: " -zero-alloc-check opt" ~flambda_only: false " test_zero_alloc_opt2.ml" ;
127
+ print_test_expected_output ~cutoff: default_cutoff ~flambda_only: false ~extra_dep: None ~exit_code: 0 " test_misplaced_attr" ;
127
128
()
Original file line number Diff line number Diff line change
1
+ let [@ zero_alloc assume] foo =
2
+ let x = 42 in
3
+ fun z -> z + x
4
+
5
+ let [@ zero_alloc] bar =
6
+ let x = 42 in
7
+ fun z -> z + x
Original file line number Diff line number Diff line change
1
+ File "test_misplaced_attr.ml", line 1, characters 5-15:
2
+ Warning 53 [misplaced-attribute]: the "zero_alloc" attribute cannot appear in this context
3
+
4
+ File "test_misplaced_attr.ml", line 5, characters 5-15:
5
+ Warning 53 [misplaced-attribute]: the "zero_alloc" attribute cannot appear in this context
You can’t perform that action at this time.
0 commit comments