annotate gcc/testsuite/gcc.dg/pr66066-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/66066 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-Wno-div-by-zero" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* Accept these unless -pedantic-errors/-Werror. */
kono
parents:
diff changeset
6 int a1 = -1 << 0;
kono
parents:
diff changeset
7 int a2 = -1 << 0 | 0;
kono
parents:
diff changeset
8 int a3 = -1 << 0 & 1;
kono
parents:
diff changeset
9 int a4 = -1 << 2 ^ 1;
kono
parents:
diff changeset
10 int a5 = 4 & -1 << 2;
kono
parents:
diff changeset
11 int a6 = (-1 << 2) ^ (1 >> 1);
kono
parents:
diff changeset
12 int a7 = 0 || (-1 << 1);
kono
parents:
diff changeset
13 int a8 = 0 ? 2 : (-1 << 1);
kono
parents:
diff changeset
14 int a9 = 1 && -1 << 0;
kono
parents:
diff changeset
15 int a10 = !(-1 << 0);
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 /* Don't accept these. */
kono
parents:
diff changeset
18 int b1 = 1 / 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
19 int b2 = 1 / (1 / 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
20 int b3 = 0 ? 2 : 1 / 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
21 int b4 = 0 || 1 / 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
22 int b5 = 0 * (1 / 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
23 int b6 = 1 * (1 / 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
24 int b7 = (1 / 0) * 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
25 int b8 = (1 / 0) * 1; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
26 int b9 = 1 && 1 / 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
27 int b10 = !(1 / 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
28 int c1 = 1 % 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
29 int c2 = 1 / (1 % 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
30 int c3 = 0 ? 2 : 1 % 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
31 int c4 = 0 || 1 % 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
32 int c5 = 0 * (1 % 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
33 int c6 = 1 * (1 % 0); /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
34 int c7 = (1 % 0) * 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
35 int c8 = (1 % 0) * 1; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
36 int c9 = 1 && 1 % 0; /* { dg-error "initializer element is not constant" } */
kono
parents:
diff changeset
37 int c10 = !(1 % 0); /* { dg-error "initializer element is not constant" } */