annotate gcc/testsuite/g++.old-deja/g++.other/sizeof3.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do run }
kono
parents:
diff changeset
2 // Copyright (C) 1999 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 // Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // C++ does not decay lvalues into rvalues until as late as possible. This
kono
parents:
diff changeset
6 // means things like the rhs of a comma operator mustn't decay. This will make
kono
parents:
diff changeset
7 // a difference if it is an array or function.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 extern "C" void abort();
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 int main (int argc, char **argv)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 int ary[10];
kono
parents:
diff changeset
14 int ary1[10];
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 if (sizeof (0,ary) != sizeof (ary))
kono
parents:
diff changeset
17 abort ();
kono
parents:
diff changeset
18 if (sizeof (argc ? ary : ary1) != sizeof (ary))
kono
parents:
diff changeset
19 abort ();
kono
parents:
diff changeset
20 return 0;
kono
parents:
diff changeset
21 }