Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / tree-ssa / pr33172.c
blob17a40d4a33d659cdc6e6a49722a6977be2ea900b
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 struct abc {
5 void (*abc_call)(void);
6 };
8 /*
9 * Use only any one of the three definitions below at a time:
11 * 1. nothing optimized away. Good.
12 * 2. call_func() _not_ optimized away, but struct xyz is. gcc disappoints.
13 * 3. both call_func() and struct xyz optimized away. Nice.
16 /* 1 */
17 /*extern int do_register(struct abc *xyz);*/
19 /* 2 */
20 static inline int do_register(struct abc *xyz)
22 return 0;
25 /* 3 */
26 /*#define do_register(xyz) do { (void)(xyz); } while (0)*/
28 static void call_func(void)
32 static struct abc xyz = {
33 .abc_call = call_func,
36 void func(void)
38 do_register(&xyz);
41 /* { dg-final { scan-tree-dump-not "call_func" "optimized"} } */
42 /* { dg-final { cleanup-tree-dump "optimized" } } */