1 /* { dg-do compile } */
2 /* { dg-options "-fanalyzer" } */
3 /* { dg-require-effective-target analyzer } */
5 typedef __SIZE_TYPE__
size_t;
9 extern int copy_from_user(void *to
, const void __user
*from
, long n
)
10 __attribute__((access (write_only
, 1, 3),
11 access (read_only
, 2, 3)
17 /* Taken from Linux: fs/binfmt_misc.c (GPL-2.0-only). */
19 int parse_command(const char __user
*buffer
, size_t count
)
25 if (copy_from_user(s
, buffer
, count
))
29 if (s
[count
- 1] == '\n') /* { dg-bogus "uninit" } */
31 if (count
== 1 && s
[0] == '0') /* { dg-bogus "uninit" } */
33 if (count
== 1 && s
[0] == '1') /* { dg-bogus "uninit" } */
35 if (count
== 2 && s
[0] == '-' && s
[1] == '1') /* { dg-bogus "uninit" } */
40 /* Not using return value from copy_from_user. */
42 int test_2 (const char __user
*buffer
, size_t count
)
47 copy_from_user(s
, buffer
, count
);