summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/asan/pr82792.C
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-11-20 16:02:55 +0000
committerRichard Sandiford <richard.sandiford@linaro.org>2017-11-20 16:02:55 +0000
commitd58952aefb03632bbb5b441d5c0bd330711f0af1 (patch)
treed046e56bfbd6a40106ae6ab96fafc954f1dfc955 /gcc/testsuite/g++.dg/asan/pr82792.C
parent648f8fc59b2cc39abd24f4c22388b346cdebcc31 (diff)
parent50221fae802a10fafe95e61d40504a58da33e98f (diff)
downloadgcc-linaro-dev/sve.tar.gz
Merge trunk into svelinaro-dev/sve
Diffstat (limited to 'gcc/testsuite/g++.dg/asan/pr82792.C')
-rw-r--r--gcc/testsuite/g++.dg/asan/pr82792.C32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/asan/pr82792.C b/gcc/testsuite/g++.dg/asan/pr82792.C
new file mode 100644
index 00000000000..99f1c35328c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/pr82792.C
@@ -0,0 +1,32 @@
+/* PR sanitizer/82792 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=address" } */
+
+extern int
+test (int i, int j)
+{
+ long c;
+ (c) = 1;
+ switch (i)
+ {
+ case 1:
+ if (j)
+ {
+ c = 1;
+ }
+ goto default_case;
+ case 2:
+ {
+ if (j)
+ {
+ c = 0;
+ }
+ }
+ __attribute ((fallthrough));
+ default_case:
+ default:
+ c = 0;
+ break;
+ }
+ return 0;
+}