xref: /third_party/ltp/tools/sparse/sparse-src/validation/constexpr-shift.c (revision f08c3bdf)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/tools/sparse/sparse-src/validation/
1f08c3bdfSopenharmony_ci#define __is_constexpr(x) \
2f08c3bdfSopenharmony_ci        (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_cistatic void test(int x) {
5f08c3bdfSopenharmony_ci	static int b[] = {
6f08c3bdfSopenharmony_ci		[__builtin_choose_expr(__is_constexpr(1 << 1), 1, x)] = 0,
7f08c3bdfSopenharmony_ci	};
8f08c3bdfSopenharmony_ci}
9f08c3bdfSopenharmony_ci
10f08c3bdfSopenharmony_ci/*
11f08c3bdfSopenharmony_ci * check-name: constexpr-shift
12f08c3bdfSopenharmony_ci */
13

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