xref: /third_party/ltp/tools/sparse/sparse-src/validation/mem2reg/packed-bitfield.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/tools/sparse/sparse-src/validation/mem2reg/
1f08c3bdfSopenharmony_cistruct s {
2f08c3bdfSopenharmony_ci	int:16;
3f08c3bdfSopenharmony_ci	int f:16;
4f08c3bdfSopenharmony_ci} __attribute__((__packed__));
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_cistatic void foo(struct s s)
7f08c3bdfSopenharmony_ci{
8f08c3bdfSopenharmony_ci	while (s.f)
9f08c3bdfSopenharmony_ci		;
10f08c3bdfSopenharmony_ci}
11f08c3bdfSopenharmony_ci
12f08c3bdfSopenharmony_ci/*
13f08c3bdfSopenharmony_ci * check-name: packed-bitfield
14f08c3bdfSopenharmony_ci * check-command: test-linearize -fmem2reg $file
15f08c3bdfSopenharmony_ci *
16f08c3bdfSopenharmony_ci * check-output-contains: store.32
17f08c3bdfSopenharmony_ci * check-output-contains: load.16
18f08c3bdfSopenharmony_ci *
19f08c3bdfSopenharmony_ci * check-output-start
20f08c3bdfSopenharmony_cifoo:
21f08c3bdfSopenharmony_ci.L0:
22f08c3bdfSopenharmony_ci	<entry-point>
23f08c3bdfSopenharmony_ci	store.32    %arg1 -> 0[s]
24f08c3bdfSopenharmony_ci	br          .L4
25f08c3bdfSopenharmony_ci
26f08c3bdfSopenharmony_ci.L4:
27f08c3bdfSopenharmony_ci	load.16     %r1 <- 2[s]
28f08c3bdfSopenharmony_ci	cbr         %r1, .L4, .L3
29f08c3bdfSopenharmony_ci
30f08c3bdfSopenharmony_ci.L3:
31f08c3bdfSopenharmony_ci	ret
32f08c3bdfSopenharmony_ci
33f08c3bdfSopenharmony_ci
34f08c3bdfSopenharmony_ci * check-output-end
35f08c3bdfSopenharmony_ci */
36

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