libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr108306.c
blob1044c646de7e33e5e23ec65fb4a91a2578707410
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-strict-overflow -fsanitize=shift -Warray-bounds" } */
4 enum psi_task_count {
5 NR_IOWAIT,
6 NR_PSI_TASK_COUNTS = 4,
7 };
9 unsigned int tasks[NR_PSI_TASK_COUNTS];
11 static void psi_group_change(unsigned int set)
13 unsigned int t;
14 unsigned int state_mask = 0;
16 for (t = 0; set; set &= ~(1 << t), t++)
17 if (set & (1 << t))
18 tasks[t]++;
21 void psi_task_switch(int sleep)
23 int set = 0;
25 if (sleep)
26 set |= (1 << NR_IOWAIT);
28 psi_group_change(set);