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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr36339.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
extern void abort (void);
2
 
3
typedef unsigned long my_uintptr_t;
4
 
5
int check_a(my_uintptr_t tagged_ptr);
6
 
7
int __attribute__((noinline)) try_a(my_uintptr_t x)
8
{
9
  my_uintptr_t heap[2];
10
  my_uintptr_t *hp = heap;
11
 
12
  hp[0] = x;
13
  hp[1] = 0;
14
  return check_a((my_uintptr_t)(void*)((char*)hp + 1));
15
}
16
 
17
int __attribute__((noinline)) check_a(my_uintptr_t tagged_ptr)
18
{
19
  my_uintptr_t *hp = (my_uintptr_t*)(void*)((char*)tagged_ptr - 1);
20
 
21
  if (hp[0] == 42 && hp[1] == 0)
22
    return 0;
23
  return -1;
24
}
25
 
26
int main(void)
27
{
28
  if (try_a(42) < 0)
29
    abort ();
30
  return 0;
31
}
32
 

powered by: WebSVN 2.1.0

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