mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
Estimated hours taken: 1 Add a test case for a newly discovered bug in simplification. tests/valid/simplify_bug.m: New file. tests/valid/Mmake: Add simplify_bug.m (not yet enabled, since we don't pass it yet).
34 lines
575 B
Mathematica
34 lines
575 B
Mathematica
% Regression test:
|
|
% When compiling this file with `mc -O-1', Mercury 0.6
|
|
% got an internal compiler error ("nondet code in det/semidet context").
|
|
|
|
:- module simplify_bug.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module require, list, std_util.
|
|
|
|
main -->
|
|
( { nasty([]) } ->
|
|
main, main
|
|
;
|
|
[]
|
|
).
|
|
|
|
:- pred nasty(list(T)::in) is nondet.
|
|
|
|
nasty(_) :-
|
|
( semidet_succeed ->
|
|
list__append(X, _, []),
|
|
X \= [],
|
|
e(X)
|
|
;
|
|
semidet_succeed
|
|
).
|
|
|
|
:- pred e(list(T)::in) is erroneous.
|
|
:- external(e/1).
|