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.dg/] [tree-ssa/] [tailcall-6.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR tree-optimization/43904.  */
2
/* { dg-do run } */
3
/* { dg-options "-O1 -foptimize-sibling-calls" } */
4
 
5
typedef __SIZE_TYPE__ size_t;
6
extern void abort(void);
7
 
8
void *memcpy(void *dest, const void *src, size_t n);
9
 
10
void
11
buggy_init(void *ptr, size_t size)
12
{
13
  const char *str = "Hello world!";
14
  memcpy(ptr, &str, size);
15
}
16
 
17
void
18
expose_bug(void *ptr, size_t size)
19
{
20
  const char *str;
21
  memcpy(&str, ptr, size);
22
  if (*str != 'H')
23
    abort ();
24
}
25
 
26
int
27
main()
28
{
29
  const char *ptr;
30
  buggy_init(&ptr, sizeof(ptr));
31
  expose_bug(&ptr, sizeof(ptr));
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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