Debian Codegraph @

gcc/testsuite/c-c++-common/ubsan/unreachable-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fsanitize=unreachable -O2 -fno-reorder-blocks -fsanitize-coverage=trace-pc -fdump-tree-optimized" } */
3 /* { dg-skip-if "" { *-*-* } { "-flto" } } */
4
5 extern unsigned int ioread32(void *);
6 struct vnic_wq_ctrl {
7 unsigned int error_status;
8 };
9 struct snic {
10 unsigned int wq_count;
11 struct vnic_wq_ctrl *wq[1];
12 int wq_lock[1];
13 };
14 void snic_log_q_error(struct snic *snic)
15 {
16 unsigned int i;
17 #pragma GCC unroll 1
18 for (i = 0; i < snic->wq_count; i++)
19 ioread32(&snic->wq[i]->error_status);
20 }
21
22 /* { dg-final { scan-tree-dump "__builtin___ubsan_handle_builtin_unreachable" "optimized" } } */