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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [builtin-noret-2.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for builtin noreturn attributes when the visible declarations
2
   are function-local.  Modified from builtin-noret-1.c by Zack Weinberg
3
   <zack@codesourcery.com>.  */
4
/* { dg-options "-multiply_defined suppress" { target powerpc-*-darwin* } } */
5
/* { dg-do link } */
6
/* { dg-require-weak "" } */
7
 
8
extern void tabort (void);
9
extern void texit (void);
10
extern void t_exit (void);
11
extern void t_Exit (void);
12
 
13
extern void link_failure (void);
14
 
15
int
16
main (void)
17
{
18
  volatile int i = 0;
19
  extern void exit (int);
20
  if (i)
21
    tabort ();
22
  if (i)
23
    texit ();
24
  if (i)
25
    t_exit ();
26
  if (i)
27
    t_Exit ();
28
  exit (0);
29
}
30
 
31
void
32
tabort (void)
33
{
34
  extern void abort (void);
35
  abort ();
36
  link_failure ();
37
}
38
 
39
void
40
texit (void)
41
{
42
  extern void exit (int);
43
  exit (1);
44
  link_failure ();
45
}
46
 
47
void
48
t_exit (void)
49
{
50
  extern void _exit (int);
51
  /* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
52
     so make it weak.  */
53
#pragma weak _exit
54
  _exit (1);
55
  link_failure ();
56
}
57
 
58
/* Some non-Unix libcs might not have _exit.  */
59
/* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
60
   so make it weak.  */
61
#pragma weak _exit
62
void
63
_exit (int i)
64
{
65
  extern void abort (void);
66
  abort ();
67
}
68
 
69
void
70
t_Exit (void)
71
{
72
  extern void _Exit (int);
73
  /* Some libcs have _Exit, and won't allow it to be re-defined,
74
     so make it weak.  */
75
#pragma weak _Exit
76
  _Exit (1);
77
  link_failure ();
78
}
79
 
80
/* Some libcs might not have _Exit.  */
81
/* Some libcs have _Exit, and won't allow it to be re-defined,
82
   so make it weak.  */
83
#pragma weak _Exit
84
void
85
_Exit (int i)
86
{
87
  extern void abort (void);
88
  abort ();
89
}

powered by: WebSVN 2.1.0

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