libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / attr-returns-nonnull.c
blobd7f39be221e3cd9c50640ad007b1c5c41207e9fb
1 /* Verify that attribute returns_nonnull on global and local function
2 declarations is merged.
3 { dg-do compile }
4 { dg-options "-Wall -fdump-tree-optimized -fdelete-null-pointer-checks" }
5 { dg-skip-if "" keeps_null_pointer_checks } */
7 void foo (void);
10 void frnn_local_local (void)
12 __attribute__ ((returns_nonnull)) void* frnn1 (void);
14 if (!frnn1 ())
15 foo ();
18 void gnr_local_local (void)
20 void* frnn1 (void);
22 if (!frnn1 ())
23 foo ();
26 void frnn_local_global (void)
28 __attribute__ ((returns_nonnull)) void* frnn2 (void);
30 if (!frnn2 ())
31 foo ();
34 void* frnn2 (void);
36 void gnr_local_global (void)
38 if (!frnn2 ())
39 foo ();
42 __attribute__ ((returns_nonnull)) void* frnn3 (void);
44 void frnn_global_local (void)
46 if (!frnn3 ())
47 foo ();
50 void gnr_global_local (void)
52 void* frnn3 (void);
54 if (!frnn3 ())
55 foo ();
59 /* { dg-final { scan-tree-dump-not "foo" "optimized" } } */