aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/dse-trivial-auto-var-init.c
blob: 5a3d4c4e3ecb6a6836e3722d764a36011846a344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Testcase for LLVM bug: https://github.com/llvm/llvm-project/issues/119646 */
/* { dg-do run } */
/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */

int b = 208;
[[gnu::noinline]]
void f(int *e, int a) {
  *e = !!b;
  if (a)
    __builtin_trap();
}
int main(void) {
  b = 0;
  f(&b, 0);
  if (b != 0)
    __builtin_trap();
}