re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / vptr-14.C
blob2247ad99fccff8b28ad080ec3efcfc766a4f061e
1 // PR sanitizer/89869
2 // { dg-do run }
3 // { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
5 struct S { S *s = 0; virtual ~S () {} };
7 void
8 foo (S *x, S *y)
10   (x->s ? y : x) = x->s;
13 int
14 main ()
16   S a;
17   foo (&a, 0);