1 /* Verify t0 is saved before use. */
2 /* { dg-do compile } */
3 /* { dg-options "-fomit-frame-pointer" } */
4 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 void __attribute__ ((interrupt))
6 foo2 (void)
7 {
8 char array[4096];
9 extern volatile int INTERRUPT_FLAG;
10 INTERRUPT_FLAG = 0;
11
12 extern volatile int COUNTER;
13 #ifdef __riscv_atomic
14 __atomic_fetch_add (&COUNTER, 1, __ATOMIC_RELAXED);
15 #else
16 COUNTER++;
17 #endif
18 }
19 /* { dg-final { scan-assembler "s\[wd\]\tt0" } } */