aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-06-16 14:25:12 +0200
committerBjörn Gustavsson <[email protected]>2014-06-16 14:32:42 +0200
commit9a9b77c72f95123ac0e6d1dab7f907a4f0f2e6a6 (patch)
tree92bc192b2a54030bcfddb0f9d8baf904f670a83b /lib/compiler/test
parent26e63b26e605a74ba0a0a58c1fb1cb0ba358efed (diff)
downloadotp-9a9b77c72f95123ac0e6d1dab7f907a4f0f2e6a6.tar.gz
otp-9a9b77c72f95123ac0e6d1dab7f907a4f0f2e6a6.tar.bz2
otp-9a9b77c72f95123ac0e6d1dab7f907a4f0f2e6a6.zip
Fix handling of latin1 characters in false ifdef branches
The fallback to latin-1 encoding would not work if the invalid UTF-8 characters occurred in a skipped branch in an -ifdef/-ifndef.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/warnings_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl
index ad4ad91f74..0637041873 100644
--- a/lib/compiler/test/warnings_SUITE.erl
+++ b/lib/compiler/test/warnings_SUITE.erl
@@ -662,6 +662,20 @@ latin1_fallback(Conf) when is_list(Conf) ->
{warnings,[{1,compile,reparsing_invalid_unicode}]}
}],
[] = run(Conf, Ts2),
+
+ Ts3 = [{latin1_fallback3,
+ %% Test that the compiler fall backs to latin-1 with
+ %% a warning if a file has no encoding and does not
+ %% contain correct UTF-8 sequences.
+ <<"-ifdef(NOTDEFINED).
+ t(_) -> \"",246,"\";
+ t(x) -> ok.
+ -endif.
+ ">>,
+ [],
+ {warnings,[{2,compile,reparsing_invalid_unicode}]}}],
+ [] = run(Conf, Ts3),
+
ok.
%%%