]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/attr-noreturn.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / attr-noreturn.c
1 /* Verify that attribute noreturn on global and local function declarations
2 is merged.
3 { dg-do compile }
4 { dg-options "-Wall -fdump-tree-optimized" } */
5
6 void foo (void);
7
8 int fnr_local_local (void)
9 {
10 __attribute__ ((noreturn)) void fnr1 (void);
11
12 fnr1 ();
13
14 foo ();
15 }
16
17 int gnr_local_local (void)
18 {
19 void fnr1 (void);
20
21 fnr1 ();
22
23 foo ();
24 }
25
26
27 int fnr_local_global (void)
28 {
29 __attribute__ ((noreturn)) void fnr2 (void);
30
31 fnr2 ();
32
33 foo ();
34 }
35
36 void fnr2 (void);
37
38 int gnr_local_global (void)
39 {
40 fnr2 ();
41
42 foo ();
43 }
44
45
46 __attribute__ ((noreturn)) void fnr3 (void);
47
48 int fnr_global_local (void)
49 {
50 fnr3 ();
51
52 foo ();
53 }
54
55 int gnr_global_local (void)
56 {
57 void fnr3 (void);
58
59 fnr3 ();
60
61 foo ();
62 }
63
64 /* { dg-final { scan-tree-dump-not "foo" "optimized" } } */