xref: /illumos-gate/usr/src/tools/smatch/src/validation/constexpr-preop.c (revision f52943a93040563107b95bccb9db87d9971ef47d)
1 static int a[] = {
2   [+0] = 0,					// OK
3   [+__builtin_choose_expr(0, 0, 0)] = 0,	// OK
4   [+0.] = 0,					// KO
5   [+__builtin_choose_expr(0, 0, 0.)] = 0,	// KO
6   [-0] = 0,					// OK
7   [-__builtin_choose_expr(0, 0, 0)] = 0,	// OK
8   [-0.] = 0,					// KO
9   [-__builtin_choose_expr(0, 0, 0.)] = 0,	// KO
10   [~0] = 0,					// OK
11   [~__builtin_choose_expr(0, 0, 0)] = 0,	// OK
12   [!0] = 0,					// OK
13   [!__builtin_choose_expr(0, 0, 0)] = 0,	// OK
14   [!0.] = 0,					// KO
15   [!__builtin_choose_expr(0, 0, 0.)] = 0,	// KO
16 };
17 
18 /*
19  * check-name: constexprness in preops
20  *
21  * check-error-start
22 constexpr-preop.c:4:5: error: bad constant expression
23 constexpr-preop.c:5:33: error: bad constant expression
24 constexpr-preop.c:8:4: error: bad constant expression
25 constexpr-preop.c:9:4: error: bad constant expression
26 constexpr-preop.c:14:4: error: bad integer constant expression
27 constexpr-preop.c:15:4: error: bad integer constant expression
28 constexpr-preop.c:10:4: error: index out of bounds in initializer
29 constexpr-preop.c:11:4: error: index out of bounds in initializer
30  * check-error-end
31  */
32