Debian Codegraph @

testsuite/small/record-nested-4.c

raw
1 /* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_NO_EXTERNALIZATION" }*/
2
3 extern int strncasecmp (const char *__s1, const char *__s2, unsigned long __n)
4 __attribute__ ((__nothrow__ )) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
5
6 extern unsigned long strlen (const char *__s)
7 __attribute__ ((__nothrow__ )) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
8
9 struct config {
10 enum sched_prio {
11 SCHED_ERR = -1,
12 SCHED_HIGH,
13 SCHED_DEFAULT,
14 SCHED_LOW
15 } prio;
16 unsigned int verbose;
17 };
18
19 /** clang-extract: from source.c:1511:1 */
20 enum sched_prio f(const char *str)
21 {
22 if (strncasecmp("high", str, strlen(str)) == 0)
23 return SCHED_HIGH;
24 else if (strncasecmp("default", str, strlen(str)) == 0)
25 return SCHED_DEFAULT;
26 else if (strncasecmp("low", str, strlen(str)) == 0)
27 return SCHED_LOW;
28 else
29 return SCHED_ERR;
30 }
31
32 /* { dg-final { scan-tree-dump "struct config *{" } } */
33 /* { dg-final { scan-tree-dump " *enum sched_prio *{" } } */