aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr109546.c
blob: ba8af0f31fa66c9b17c592ec1e5010f64c086ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized" } */

void foo(void);
static int a, c;
static int *b = &a;
static int **d = &b;
void assert_fail() __attribute__((__noreturn__));
int main() {
  int *e = *d;
  if (e == &a || e == &c);
  else {
    __builtin_unreachable();
  assert_fail();
  }
  if (e == &a || e == &c);
  else
    foo();
}

/* { dg-final { scan-tree-dump-not "assert_fail" "optimized" } } */
/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */