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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20021204-1.c] - Blame information for rev 199

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

Line No. Rev Author Line
1 149 jeremybenn
/* This test was miscompiled when using sibling call optimization,
2
   because X ? Y : Y - 1 optimization changed X into !X in place
3
   and haven't reverted it if do_store_flag was successful, so
4
   when expanding the expression the second time it was
5
   !X ? Y : Y - 1.  */
6
 
7
extern void abort (void);
8
extern void exit (int);
9
 
10
void foo (int x)
11
{
12
  if (x != 1)
13
    abort ();
14
}
15
 
16
int z;
17
 
18
int main (int argc, char **argv)
19
{
20
  char *a = "test";
21
  char *b = a + 2;
22
 
23
  foo (z > 0 ? b - a : b - a - 1);
24
  exit (0);
25
}

powered by: WebSVN 2.1.0

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