1 /* { dg-do compile } */
2 /* { dg-options "-march=r1 -mno-cdx -mno-bmx -O2" } */
3 /* { dg-final { scan-assembler-times "stwio\tr., 12816\\(r\[2-9\]\\)" 1 } } */
4 /* { dg-final { scan-assembler-times "stwio\tr., 12816\\(r0\\)" 1 } } */
5 /* { dg-final { scan-assembler-times "stwio\tr., 528\\(r0\\)" 1 } } */
6
7 /* These functions should not spill to stack. */
8 /* { dg-final { scan-assembler-not "addi\tsp, sp" } } */
9
10 #define addr1 ((volatile int *) 0x43210)
11 #define addr2 ((volatile int *) 0x3210)
12 #define addr3 ((volatile int *) 0x210)
13
14 #define SET(l,r) __builtin_stwio ((l), (r))
15
16 void foo1 (int x) { SET (addr1, x); }
17 void foo2 (int x) { SET (addr2, x); }
18 void foo3 (int x) { SET (addr3, x); }