Files
mercury/tests/valid/liveness_ite.m
Zoltan Somogyi c03b11ca48 Update the style of more test cases.
And updated expected outputs for changed line numbers.
2021-07-27 19:29:21 +10:00

58 lines
1.5 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Regression test.
% The compiler aborted on this module with tracing enabled.
%
% Uncaught Mercury exception:
% Software Error: liveness.m: Unexpected:
% branches of if-then-else disagree on liveness
% First:
% Rest: TypeInfo_for_T_8
%
%---------------------------------------------------------------------------%
:- module liveness_ite.
:- interface.
:- pred mypred(T::in, T::out) is erroneous.
%---------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
:- implementation.
:- import_module exception.
%---------------------------------------------------------------------------%
:- type rollback_exception
---> rollback_invalid_transaction
; rollback_retry.
:- type stm_validation_result
---> stm_transaction_valid
; stm_transaction_invalid.
mypred(In, _Out) :-
( if semidet_true then
IsValid = ff,
(
IsValid = stm_transaction_valid,
throw(rollback_retry)
;
IsValid = stm_transaction_invalid,
throw(rollback_invalid_transaction)
)
else
throw(In)
).
:- func ff = stm_validation_result.
:- pragma no_inline(ff/0).
ff = stm_transaction_valid.
%---------------------------------------------------------------------------%