Debian Codegraph @

gcc/testsuite/g++.dg/lto/alias-4_0.C

raw
1 /* { dg-lto-do run } */
2 /* { dg-lto-options { { -O3 -flto -fno-early-inlining -fdump-ipa-cgraph} } } */
3 __attribute__ ((used))
4 short *ptr_init, **ptr=&ptr_init;
5
6 __attribute__ ((used))
7 struct a {
8 int *aptr;
9 /* On ARM va_list is an anonymous structure containing pointer.
10 This disable ODR TBAA on it. */
11 short b;
12 } a, *aptr=&a;
13
14 void
15 write_ptr ()
16 {
17 *aptr = a;
18 }
19
20 __attribute__ ((used))
21 void
22 test ()
23 {
24 *ptr = (short int *)0;
25 write_ptr ();
26 if (!__builtin_constant_p (*ptr == (void *)0))
27 __builtin_abort ();
28 }
29 int
30 main()
31 {
32 test ();
33 return 0;
34 }
35 /* On ARM the testcase used to fail because struct a got in conflict with builtin
36 va_list type. Check that this does not happen. */
37 /* { dg-final { scan-wpa-ipa-dump-not "ODR and non-ODR type conflict" "cgraph" } } */