view gcc/testsuite/gcc.dg/pr27528.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

/* 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 does not match" } */
  /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */

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

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

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

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