OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [expr/] [cond1.C] - Rev 154

Compare with Previous | Blame | View Log

// { dg-do run }

// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 17 Oct 2002 <nathan@codesourcery.com>

// PR 7209. We didn't SAVE_EXPR in the right place

char a[2][1][16]={
  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}};

int f() {return 0;}

char * Foo (int d)
{
  char *c1;

  c1=a[d==0 ? 0 : 1][f()];

  return c1;
}

int main ()
{
  if (Foo (0) != (void *)a)
    return 1;
  return 0;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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