summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20000108-1.c
blob: 4391be2ad8ebbc7c0c48e48a9c309fd91091a31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright (C) 2000  Free Software Foundation.

   by Alexandre Oliva  <oliva@lsd.ic.unicamp.br>  */

/* { dg-do run } */
/* { dg-options "-O3" } */

extern void abort (void);

void foo () {} /* unused, but essential to trigger the bug */

int main () {
  int i;
  /* use asms to prevent optimizations */
  /* i = -1; */ asm ("" : "=r" (i) : "0" (-1));
  /* i =  1; */ asm ("" : "=r" (i) : "0" (i ? 1 : 2));
  if (i != 1)
    abort();
  return 0;
}