diff options
| author | Björn Gustavsson <[email protected]> | 2013-03-19 15:09:19 +0100 |
|---|---|---|
| committer | Björn Gustavsson <[email protected]> | 2013-03-19 15:09:19 +0100 |
| commit | 6796e1e23ec1c03ed704b0e5d476797b5b5e985a (patch) | |
| tree | f56d052ec1da1df885247de1620f0dcd52e89869 /lib/compiler/test | |
| parent | 087cb864617623392d130c33a98f53d30e8a0758 (diff) | |
| parent | f70f8f549bc0adca05f89e860b87dccd20a1e086 (diff) | |
| download | otp-6796e1e23ec1c03ed704b0e5d476797b5b5e985a.tar.gz otp-6796e1e23ec1c03ed704b0e5d476797b5b5e985a.tar.bz2 otp-6796e1e23ec1c03ed704b0e5d476797b5b5e985a.zip | |
Merge branch 'bjorn/compiler/fix-slow-compilation/OTP-10939' into maint
* bjorn/compiler/fix-slow-compilation/OTP-10939:
Fix slow compilation of complex guards
Diffstat (limited to 'lib/compiler/test')
| -rw-r--r-- | lib/compiler/test/andor_SUITE.erl | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index 0d00769704..4ffbe07e32 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -21,7 +21,8 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1, - combined/1,in_case/1,before_and_inside_if/1]). + combined/1,in_case/1,before_and_inside_if/1, + slow_compilation/1]). -include_lib("test_server/include/test_server.hrl"). @@ -472,6 +473,36 @@ before_and_inside_if_2(XDo1, XDo2, Do3) -> end, {CH1,CH2}. + +-record(state, {stack = []}). + +slow_compilation(_) -> + %% The function slow_compilation_1 used to compile very slowly. + ok = slow_compilation_1({a}, #state{}). + +slow_compilation_1(T1, #state{stack = [T2|_]}) + when element(1, T2) == a, element(1, T1) == b, element(1, T1) == c -> + ok; +slow_compilation_1(T, _) + when element(1, T) == a1; element(1, T) == b1; element(1, T) == c1 -> + ok; +slow_compilation_1(T, _) + when element(1, T) == a2; element(1, T) == b2; element(1, T) == c2 -> + ok; +slow_compilation_1(T, _) when element(1, T) == a -> + ok; +slow_compilation_1(T, _) + when + element(1, T) == a, + (element(1, T) == b) and (element(1, T) == c) -> + ok; +slow_compilation_1(_, T) when element(1, T) == a -> + ok; +slow_compilation_1(_, T) when element(1, T) == b -> + ok; +slow_compilation_1(T, _) when element(1, T) == a -> + ok. + %% Utilities. check(V1, V0) -> |
