xref: /third_party/ltp/tools/sparse/sparse-src/validation/function-attribute.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/tools/sparse/sparse-src/validation/
1f08c3bdfSopenharmony_ci#define __pure __attribute__((pure))
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_cistatic __pure int funi(int val)
5f08c3bdfSopenharmony_ci{
6f08c3bdfSopenharmony_ci	return val;
7f08c3bdfSopenharmony_ci}
8f08c3bdfSopenharmony_ci
9f08c3bdfSopenharmony_cistatic __pure int *funp(int *ptr)
10f08c3bdfSopenharmony_ci{
11f08c3bdfSopenharmony_ci	return ptr;
12f08c3bdfSopenharmony_ci}
13f08c3bdfSopenharmony_ci
14f08c3bdfSopenharmony_cistatic void foo(int val, int *ptr)
15f08c3bdfSopenharmony_ci{
16f08c3bdfSopenharmony_ci	int  nbr = funi(val);
17f08c3bdfSopenharmony_ci	int *res = funp(ptr);
18f08c3bdfSopenharmony_ci}
19f08c3bdfSopenharmony_ci
20f08c3bdfSopenharmony_ci/*
21f08c3bdfSopenharmony_ci * check-name: function-attribute
22f08c3bdfSopenharmony_ci */
23

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