xref: /third_party/ltp/tools/sparse/sparse-src/validation/mem2reg/alias-mixed.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/tools/sparse/sparse-src/validation/mem2reg/
1f08c3bdfSopenharmony_ciextern int g;
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_cistatic int foo(int *p)
5f08c3bdfSopenharmony_ci{
6f08c3bdfSopenharmony_ci	*p = 1;
7f08c3bdfSopenharmony_ci	g = 2;
8f08c3bdfSopenharmony_ci	return *p == 1;
9f08c3bdfSopenharmony_ci}
10f08c3bdfSopenharmony_ci
11f08c3bdfSopenharmony_cistatic int bar(int *p)
12f08c3bdfSopenharmony_ci{
13f08c3bdfSopenharmony_ci	g = 1;
14f08c3bdfSopenharmony_ci	*p = 2;
15f08c3bdfSopenharmony_ci	return g == 1;
16f08c3bdfSopenharmony_ci}
17f08c3bdfSopenharmony_ci
18f08c3bdfSopenharmony_cistatic void test(void)
19f08c3bdfSopenharmony_ci{
20f08c3bdfSopenharmony_ci	foo(&g);
21f08c3bdfSopenharmony_ci	bar(&g);
22f08c3bdfSopenharmony_ci}
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_ci/*
25f08c3bdfSopenharmony_ci * check-name: alias symbol/pointer
26f08c3bdfSopenharmony_ci * check-command: test-linearize $file
27f08c3bdfSopenharmony_ci * check-output-ignore
28f08c3bdfSopenharmony_ci *
29f08c3bdfSopenharmony_ci * check-output-excludes: ret\\..* *\\$1
30f08c3bdfSopenharmony_ci */
31

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