diff options
author | Björn Gustavsson <[email protected]> | 2018-11-30 14:41:59 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-30 14:43:56 +0100 |
commit | 4a9f0baf0bed804473fc71d9aa0d8f0f265a0cd3 (patch) | |
tree | 1615d6885f32426d89f3af56c80d8ea2b28c7a24 | |
parent | 89f37d9ba5925e3bb570c15560d59ad2be8f1d19 (diff) | |
download | otp-4a9f0baf0bed804473fc71d9aa0d8f0f265a0cd3.tar.gz otp-4a9f0baf0bed804473fc71d9aa0d8f0f265a0cd3.tar.bz2 otp-4a9f0baf0bed804473fc71d9aa0d8f0f265a0cd3.zip |
Cover code in beam_ssa_opt
-rw-r--r-- | lib/compiler/test/match_SUITE.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 10527775f4..8393dced06 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -653,9 +653,13 @@ coverage(Config) when is_list(Config) -> %% Cover beam_ssa_dead. {expr,key} = coverage_4([literal,get], [[expr,key]]), {expr,key} = coverage_4([expr,key], []), + a = coverage_5([8,8,8], #coverage_id{bool=true}), b = coverage_5([], #coverage_id{bool=true}), + %% Cover beam_ssa_opt. + ok = coverage_6(), + ok. coverage_1(B, Tag) -> @@ -683,6 +687,22 @@ coverage_5(Config, TermId) coverage_5(_Config, #coverage_id{bool=true}) -> b. +coverage_6() -> + X = 17, + case + case id(1) > 0 of + true -> + 17; + false -> + 42 + end + of + X -> + ok; + V -> + %% Cover beam_ssa_opt:make_literal/2. + error([error,X,V]) + end. grab_bag(_Config) -> [_|T] = id([a,b,c]), |