1 /* { dg-do compile } */
2 /* { dg-options "-O -mgpopt -march=r2" } */
3 
4 /* The ldio/stio builtins must not use GP-relative addresses for
5    small data objects in R2.  This is because the address offset field
6    has been reduced to 12 bits in R2, and %gprel is a 16-bit relocation.  */
7 
8 extern volatile unsigned int frob;
9 
10 volatile unsigned int frob = 0;
11 
foo(unsigned int val)12 void foo (unsigned int val)
13 {
14   __builtin_stwio (&frob, val);
15 }
16 
17 /* { dg-final { scan-assembler "stwio\\t" } } */
18 /* { dg-final { scan-assembler-not "stwio\\t.*%gprel(frob)" } } */
19 
20