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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20031023-1.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
#ifndef ASIZE
2
# define ASIZE 0x10000000000UL
3
#endif
4
 
5
#include <limits.h>
6
 
7
#if LONG_MAX < 8 * ASIZE
8
# undef ASIZE
9
# define ASIZE 4096
10
#endif
11
 
12
extern void abort (void);
13
 
14
int __attribute__((noinline))
15
foo (const char *s)
16
{
17
  if (!s)
18
    return 1;
19
  if (s[0] != 'a')
20
    abort ();
21
  s += ASIZE - 1;
22
  if (s[0] != 'b')
23
    abort ();
24
  return 0;
25
}
26
 
27
int (*fn) (const char *) = foo;
28
 
29
int __attribute__((noinline))
30
bar (void)
31
{
32
  char s[ASIZE];
33
  s[0] = 'a';
34
  s[ASIZE - 1] = 'b';
35
  foo (s);
36
  foo (s);
37
  return 0;
38
}
39
 
40
int __attribute__((noinline))
41
baz (long i)
42
{
43
  if (i)
44
    return fn (0);
45
  else
46
    {
47
      char s[ASIZE];
48
      s[0] = 'a';
49
      s[ASIZE - 1] = 'b';
50
      foo (s);
51
      foo (s);
52
      return fn (0);
53
    }
54
}
55
 
56
int
57
main (void)
58
{
59
  if (bar ())
60
    abort ();
61
  if (baz (0) != 1)
62
    abort ();
63
  if (baz (1) != 1)
64
    abort ();
65
  return 0;
66
}

powered by: WebSVN 2.1.0

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