summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/asan
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/asan')
-rw-r--r--gcc/testsuite/g++.dg/asan/pr81340.C4
-rw-r--r--gcc/testsuite/g++.dg/asan/pr82792.C32
2 files changed, 34 insertions, 2 deletions
diff --git a/gcc/testsuite/g++.dg/asan/pr81340.C b/gcc/testsuite/g++.dg/asan/pr81340.C
index 76ac08a9a56..9db5bb46ce7 100644
--- a/gcc/testsuite/g++.dg/asan/pr81340.C
+++ b/gcc/testsuite/g++.dg/asan/pr81340.C
@@ -10,13 +10,13 @@ public:
a(char *) : c(0, d) {}
};
class e {
- int f(const int &, const int &, const int &, bool, bool, bool, int, bool);
+ void f(const int &, const int &, const int &, bool, bool, bool, int, bool);
};
class g {
public:
static g *h();
void i(a, void *);
};
-int e::f(const int &, const int &, const int &, bool j, bool, bool, int, bool) {
+void e::f(const int &, const int &, const int &, bool j, bool, bool, int, bool) {
g::h()->i("", &j);
}
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;
+}