From: No Author Date: Tue, 22 Oct 2002 09:06:46 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.2.1~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d6bdff3035dd06971530b1cfadaa7b3607146af;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_2-branch'. From-SVN: r58407 --- diff --git a/gcc/testsuite/g++.dg/expr/cond1.C b/gcc/testsuite/g++.dg/expr/cond1.C new file mode 100644 index 000000000000..8fb3c0f4f34b --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/cond1.C @@ -0,0 +1,28 @@ +// { dg-do run } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 17 Oct 2002 + +// 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; +}