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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [s390/] [frame-addr2.c] - Blame information for rev 378

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

Line No. Rev Author Line
1 324 jeremybenn
/* builtin_frame_address(n) with n>0 has always been troublesome.  */
2
 
3
/* { dg-do run } */
4
/* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain" } */
5
 
6
#ifdef __s390x__
7
#define SAVE_AREA_SIZE 160
8
#else
9
#define SAVE_AREA_SIZE 96
10
#endif
11
extern void abort(void);
12
 
13
#define EXPAND_CHECK(n)                                         \
14
  void __attribute__((noinline))                                \
15
    foo1_##n (void *p)                                          \
16
  {                                                             \
17
    if (p - __builtin_frame_address (n) != SAVE_AREA_SIZE)      \
18
      abort ();                                                 \
19
  }                                                             \
20
  void __attribute__((noinline))                                \
21
    foo2_##n (void *p)                                          \
22
  {                                                             \
23
    if (p - __builtin_frame_address (n) != SAVE_AREA_SIZE)      \
24
      abort ();                                                 \
25
    foo1_##n (__builtin_frame_address (n));                     \
26
  }                                                             \
27
  void __attribute__((noinline))                                \
28
    foo3_##n ()                                                 \
29
  {                                                             \
30
    foo2_##n (__builtin_frame_address (n));                     \
31
  }                                                             \
32
  void __attribute__((noinline))                                \
33
    foo4_##n ()                                                 \
34
  {                                                             \
35
    foo3_##n ();                                                \
36
  }
37
 
38
EXPAND_CHECK (0)
39
EXPAND_CHECK (1)
40
EXPAND_CHECK (2)
41
 
42
int
43
main ()
44
{
45
  foo4_0 ();
46
  foo4_1 ();
47
  foo4_2 ();
48
 
49
  return 0;
50
}

powered by: WebSVN 2.1.0

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