modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/compile/pr38789.c (about)

     1  /* PR tree-optimization/38789 */
     2  /* { dg-do compile } */
     3  
     4  void
     5  baz (int v)
     6  {
     7    unsigned a = (v == 1) ? 1 : 2;
     8  
     9    if (__builtin_constant_p (a))
    10      asm volatile ("# constant %0" :: "i" (a));
    11    else
    12      asm volatile ("# register %0" :: "r" (a));
    13  
    14    a = 6;
    15    if (__builtin_constant_p (a))
    16      asm volatile ("# constant %0" :: "i" (a));
    17    else
    18      asm volatile ("# register %0" :: "r" (a));
    19  }