1f08c3bdfSopenharmony_cistatic unsigned int bad_nbr_args_cte(int a)
2f08c3bdfSopenharmony_ci{
3f08c3bdfSopenharmony_ci	int r = 0;
4f08c3bdfSopenharmony_ci	r |= __builtin_bswap16();
5f08c3bdfSopenharmony_ci	r |= __builtin_bswap16(1, 2);
6f08c3bdfSopenharmony_ci	r |= __builtin_bswap32();
7f08c3bdfSopenharmony_ci	r |= __builtin_bswap32(1, 2);
8f08c3bdfSopenharmony_ci	r |= __builtin_bswap64();
9f08c3bdfSopenharmony_ci	r |= __builtin_bswap64(1, 2);
10f08c3bdfSopenharmony_ci	return r;
11f08c3bdfSopenharmony_ci}
12f08c3bdfSopenharmony_ci
13f08c3bdfSopenharmony_cistatic unsigned int bad_nbr_args_var(int a, int b)
14f08c3bdfSopenharmony_ci{
15f08c3bdfSopenharmony_ci	int r = 0;
16f08c3bdfSopenharmony_ci	r |= __builtin_bswap16();
17f08c3bdfSopenharmony_ci	r |= __builtin_bswap16(a, b);
18f08c3bdfSopenharmony_ci	r |= __builtin_bswap32();
19f08c3bdfSopenharmony_ci	r |= __builtin_bswap32(a, b);
20f08c3bdfSopenharmony_ci	r |= __builtin_bswap64();
21f08c3bdfSopenharmony_ci	r |= __builtin_bswap64(a, b);
22f08c3bdfSopenharmony_ci	return r;
23f08c3bdfSopenharmony_ci}
24f08c3bdfSopenharmony_ci
25f08c3bdfSopenharmony_ci/*
26f08c3bdfSopenharmony_ci * check-name: builtin-args-checking
27f08c3bdfSopenharmony_ci * check-command: sparse $file
28f08c3bdfSopenharmony_ci * check-description: Check that the arguments checking is done
29f08c3bdfSopenharmony_ci *                    for expanded builtins with a prototype.
30f08c3bdfSopenharmony_ci *
31f08c3bdfSopenharmony_ci * check-error-start
32f08c3bdfSopenharmony_cibuiltin-args-checking.c:4:31: error: not enough arguments for function __builtin_bswap16
33f08c3bdfSopenharmony_cibuiltin-args-checking.c:5:31: error: too many arguments for function __builtin_bswap16
34f08c3bdfSopenharmony_cibuiltin-args-checking.c:6:31: error: not enough arguments for function __builtin_bswap32
35f08c3bdfSopenharmony_cibuiltin-args-checking.c:7:31: error: too many arguments for function __builtin_bswap32
36f08c3bdfSopenharmony_cibuiltin-args-checking.c:8:31: error: not enough arguments for function __builtin_bswap64
37f08c3bdfSopenharmony_cibuiltin-args-checking.c:9:31: error: too many arguments for function __builtin_bswap64
38f08c3bdfSopenharmony_cibuiltin-args-checking.c:16:31: error: not enough arguments for function __builtin_bswap16
39f08c3bdfSopenharmony_cibuiltin-args-checking.c:17:31: error: too many arguments for function __builtin_bswap16
40f08c3bdfSopenharmony_cibuiltin-args-checking.c:18:31: error: not enough arguments for function __builtin_bswap32
41f08c3bdfSopenharmony_cibuiltin-args-checking.c:19:31: error: too many arguments for function __builtin_bswap32
42f08c3bdfSopenharmony_cibuiltin-args-checking.c:20:31: error: not enough arguments for function __builtin_bswap64
43f08c3bdfSopenharmony_cibuiltin-args-checking.c:21:31: error: too many arguments for function __builtin_bswap64
44f08c3bdfSopenharmony_ci * check-error-end
45f08c3bdfSopenharmony_ci */
46