aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr27528.c
blob: c9bb238e96ba84bfbc9740e406c6109ef6251616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Check the warnings and errors generated for asm operands that aren't
   obviously constant but that are constrained to be constants.  */
/* { dg-options "" } */

int bar (int);
void
foo (int *x, int y)
{
  int constant = 0;
  asm ("# %0" :: "i" (x)); /* { dg-warning "probably doesn't match" } */
  /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */

  asm ("# %0" :: "i" (bar (*x))); /* { dg-warning "probably doesn't match" } */
  /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */

  asm ("# %0" :: "i" (*x + 0x11)); /* { dg-warning "probably doesn't match" } */
  /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */

  asm ("# %0" :: "i" (constant)); /* { dg-warning "probably doesn't match" } */
  /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */

  asm ("# %0" :: "i" (y * 0)); /* folded */
}