Files
mercury/tests/hard_coded/bug452.exp
Zoltan Somogyi 54ea0dbffc Fix a problem in switch code generation.
This problem is the cause of Mantis bug #452.

compiler/switch_util.m:
    Don't require a bit vector check for cannot_fail switches,
    even in cases where the switch arms do not completely cover
    the range of possible values in the switched-on variable's type;
    if the switch is cannot_fail, then the switch variable cannot have
    any of the "missing" values when the switch is entered.

tests/hard_coded/bug452.{m,exp}:
    A regression test for the bug.

tests/hard_coded/Mmakefile:
    Enable the new test case.
2018-02-22 13:33:05 +11:00

21 lines
314 B
Plaintext

thing1 cat1 -> cat1
thing1 cat2 -> cat1
thing1 nocat -> cat1
thing2 cat1 -> cat1
thing2 cat2 -> cat1
thing2 nocat -> cat1
nothing cat1 -> cat1
nothing cat2 -> cat2
nothing nocat -> nocat
thing3 cat1 -> cat2
thing3 cat2 -> cat2
thing3 nocat -> cat2
thing4 cat1 -> cat2
thing4 cat2 -> cat2
thing4 nocat -> cat2