xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.oliva/ext1.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // Copyright (C) 1999 Free Software Foundation
2 
3 // by Alexandre Oliva <oliva@dcc.unicamp.br>
4 // simplified from bug report by Michael Rosenbruch <Rosenbruch@bfw-online.de>
5 
6 // Special g++ Options:
7 // execution test - XFAIL *-*-*
8 
9 extern "C" void abort();
10 
main()11 int main () {
12   char x[1];
13   char *y = x ? /* implicit x */ : 0;
14   /* For some reason, the array x is copied twice, and y points to the
15      second copy (the first is never used).  If x is explicit, no copy
16      is created, and the program succeeds.  */
17   if (x != y)
18     abort();
19 }
20