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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [builtin-noret-1.c] - Blame information for rev 816

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

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

powered by: WebSVN 2.1.0

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