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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [sizeof3.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Copyright (C) 1999 Free Software Foundation, Inc.
3
// Contributed by Nathan Sidwell 5 Sep 1999 
4
 
5
// C++ does not decay lvalues into rvalues until as late as possible. This
6
// means things like the rhs of a comma operator mustn't decay. This will make
7
// a difference if it is an array or function.
8
 
9
extern "C" void abort();
10
 
11
int main (int argc, char **argv)
12
{
13
  int ary[10];
14
  int ary1[10];
15
 
16
  if (sizeof (0,ary) != sizeof (ary))
17
    abort ();
18
  if (sizeof (argc ? ary : ary1) != sizeof (ary))
19
    abort ();
20
  return 0;
21
}

powered by: WebSVN 2.1.0

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