summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr46491.c
blob: 82f704c266f74fd4f3bd4dd22ed85fca0a36f630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR tree-optimization/46491 */
/* { dg-do run } */
/* { dg-options "-O2" } */

extern void abort (void);

__attribute__((noinline)) int
foo (int *p)
{
  int r;
  asm ("movl $6, (%1)\n\txorl %0, %0" : "=r" (r) : "r" (p) : "memory");
  return r;
}

int
main (void)
{
  int p = 8;
  if ((foo (&p) ? : p) != 6)
    abort ();
  return 0;
}