OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [noreturn-7.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR optimization/13394 */
2
/* Origin: Carlo Wood <carlo@gcc.gnu.org> */
3
 
4
/* Verify that a bogus "function does return" warning is not issued
5
   in presence of tail recursion within a noreturn function.  */
6
 
7
/* { dg-do compile } */
8
/* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn" } */
9
 
10
 
11
void f(void) __attribute__ ((__noreturn__));
12
void _exit(int status) __attribute__ ((__noreturn__));
13
 
14
int z = 0;
15
 
16
void g() /* { dg-warning "might be candidate" } */
17
{
18
  if (++z > 10)
19
    _exit(0);
20
  g();
21
}
22
 
23
void f()
24
{
25
  if (++z > 10)
26
    _exit(0);
27
  f();
28
}             /* { dg-bogus "does return" } */
29
 
30
int h() /* { dg-warning "might be candidate" } */
31
{
32
  if (++z > 10)
33
    _exit(0);
34
  return h();
35
}             /* { dg-bogus "end of non-void function" } */
36
 
37
int k() /* { dg-warning "might be candidate" } */
38
{
39
  if (++z > 10)
40
    _exit(0);
41
  k();
42
}             /* { dg-warning "control reaches" } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.