Create TriggerTest.
[riscv-tests.git] / debug / programs / init.c
1 int main(void);
2
3 void handle_trap(unsigned int mcause, unsigned int mepc, unsigned int sp)
4 {
5 while (1)
6 ;
7 }
8
9 void _exit(int status)
10 {
11 // Make sure gcc doesn't inline _exit, so we can actually set a breakpoint
12 // on it.
13 volatile int i = 42;
14 while (i)
15 ;
16 // _exit isn't supposed to return.
17 while (1)
18 ;
19 }
20
21 void _init()
22 {
23 _exit(main());
24 }