2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / attrib-1.C
blobf701d02dad3a110dd33c3335888297636f7b241c
1 // { dg-do compile }
2 // { dg-options "-fsanitize=undefined -Wall -Wno-unused-variable -std=c++11" }
4 typedef const long int L;
6 __attribute__((no_sanitize_undefined)) void
7 foo (int *p, L *l)
9   int &r = *p;
10   auto &r2 = *p;
11   L &lr = *l;
12   auto &&r3 = *p;
15 struct U
17   int a;
18   void foo () {}
21 __attribute__((no_sanitize_undefined)) void
22 bar (U *p)
24   p->foo ();
27 // { dg-final { scan-assembler-not "__ubsan_handle" } }