]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/noreturn-1.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / noreturn-1.c
CommitLineData
356fcc67
JJ
1/* { dg-do compile } *
2/* { dg-options "-O2 -fdump-tree-ssa -std=gnu11" } */
3/* { dg-final { scan-tree-dump-times "__builtin_unreachable" 4 "ssa" } } */
4
5void bar1 (void);
6void bar2 (void);
7void bar3 (void);
8void bar4 (void);
9
10_Noreturn void
11foo1 (int *p, int y)
12{
13 bar1 ();
14 *p = y;
15 return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
16} /* { dg-warning "'noreturn' function does return" "" { target *-*-* } .-1 } */
17
18_Noreturn void
19foo2 (int *p, int y)
20{
21 bar2 ();
22 *p = y;
23} /* { dg-warning "'noreturn' function does return" } */
24
25_Noreturn void
26foo3 (int *p, int y)
27{
28 if (y > 10)
29 return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
30 bar3 ();
31 *p = y;
32 return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
33} /* { dg-warning "'noreturn' function does return" } */
34
35_Noreturn void
36foo4 (int *p, int y)
37{
38 if (y > 10)
39 return; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
40 bar4 ();
41 *p = y;
42} /* { dg-warning "'noreturn' function does return" } */