annotate gcc/testsuite/g++.dg/cpp1z/eval-order6.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
1 // PR c++/91987
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
2 // { dg-do run }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
3 // { dg-options "-fstrong-eval-order" }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
4
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
5 int
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
6 foo ()
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
7 {
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
8 int x = 5;
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
9 int r = x << (x = 3, 2);
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
10 if (x != 3)
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
11 __builtin_abort ();
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
12 return r;
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
13 }
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
14
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
15 int
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
16 main ()
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
17 {
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
18 if (foo () != (5 << 2))
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
19 __builtin_abort ();
1830386684a0 gcc-9.2.0
anatofuz
parents:
diff changeset
20 }