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      for (i = 0; i < snic->wq_count; i++)
      18          ioread32(&snic->wq[i]->error_status);
      19  }
      20  
      21  /* { dg-final { scan-tree-dump "__builtin___ubsan_handle_builtin_unreachable" "optimized" } } */