Files
mercury/tests/hard_coded/dense_lookup_switch.m
David Jeffery f29668fad6 Added a pragma(no_inline...) so that this test case _actually_ fails
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.
1997-09-24 03:26:51 +00:00

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")
).