Debian Codegraph @

gcc/testsuite/gcc.dg/pr108306.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-strict-overflow -fsanitize=shift -Warray-bounds" } */
3
4 enum psi_task_count {
5 NR_IOWAIT,
6 NR_PSI_TASK_COUNTS = 4,
7 };
8
9 unsigned int tasks[NR_PSI_TASK_COUNTS];
10
11 static void psi_group_change(unsigned int set)
12 {
13 unsigned int t;
14 unsigned int state_mask = 0;
15
16 for (t = 0; set; set &= ~(1 << t), t++)
17 if (set & (1 << t))
18 tasks[t]++;
19 }
20
21 void psi_task_switch(int sleep)
22 {
23 int set = 0;
24
25 if (sleep)
26 set |= (1 << NR_IOWAIT);
27
28 psi_group_change(set);
29 }