view gcc/testsuite/gcc.c-torture/compile/pr38789.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR tree-optimization/38789 */
/* { dg-do compile } */

void
baz (int v)
{
  unsigned a = (v == 1) ? 1 : 2;

  if (__builtin_constant_p (a))
    asm volatile ("# constant %0" :: "i" (a));
  else
    asm volatile ("# register %0" :: "r" (a));

  a = 6;
  if (__builtin_constant_p (a))
    asm volatile ("# constant %0" :: "i" (a));
  else
    asm volatile ("# register %0" :: "r" (a));
}