mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 14:24:11 +00:00
Estimated hours taken: 0.001 test/hard_coded/dense_lookup_switch.m: Added a pragma(no_inline...) so that this test case _actually_ fails if lookup switches aren't being handled properly. When inlined, the switch gets optimised away.
27 lines
424 B
Mathematica
27 lines
424 B
Mathematica
|
|
:- module dense_lookup_switch.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- type foo ---> a;b;c;d;e;f;g;h.
|
|
|
|
main --> bar(e).
|
|
|
|
:- pragma no_inline(bar/3).
|
|
|
|
:- pred bar(foo::in, io__state::di, io__state::uo) is det.
|
|
bar(X) -->
|
|
(
|
|
{ X = a ; X = b ; X = c ; X = d }
|
|
->
|
|
io__write_string("a or b or c or d\n")
|
|
;
|
|
io__write_string("something else\n")
|
|
).
|