xref: /third_party/ltp/tools/sparse/sparse-src/validation/enum-bounds.c (revision f08c3bdf)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/tools/sparse/sparse-src/validation/
1f08c3bdfSopenharmony_cienum bound_int_max {
2f08c3bdfSopenharmony_ci	IMAX = __INT_MAX__,
3f08c3bdfSopenharmony_ci};
4f08c3bdfSopenharmony_ci_Static_assert([typeof(IMAX)] == [int], "");
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_cienum bound_int_maxp1 {
7f08c3bdfSopenharmony_ci	IMP1 = __INT_MAX__ + 1L,
8f08c3bdfSopenharmony_ci};
9f08c3bdfSopenharmony_ci_Static_assert([typeof(IMP1)] == [unsigned int], "");
10f08c3bdfSopenharmony_ci
11f08c3bdfSopenharmony_cienum bound_int_maxm1 {
12f08c3bdfSopenharmony_ci	IMM1 = -__INT_MAX__ - 1L,
13f08c3bdfSopenharmony_ci};
14f08c3bdfSopenharmony_ci_Static_assert([typeof(IMM1)] == [int], "");
15f08c3bdfSopenharmony_ci
16f08c3bdfSopenharmony_cienum bound_int_maxm2 {
17f08c3bdfSopenharmony_ci	IMM2 = -__INT_MAX__ - 2L,
18f08c3bdfSopenharmony_ci};
19f08c3bdfSopenharmony_ci_Static_assert([typeof(IMM2)] == [long], "");
20f08c3bdfSopenharmony_ci
21f08c3bdfSopenharmony_ci/*
22f08c3bdfSopenharmony_ci * check-name: enum-bounds
23f08c3bdfSopenharmony_ci * check-command: sparse -m64 $file
24f08c3bdfSopenharmony_ci * check-assert: sizeof(long) == 8
25f08c3bdfSopenharmony_ci */
26

Indexes created Thu Nov 07 10:32:03 CST 2024