xref: /qemu/tests/tcg/multiarch/system/interrupt.c (revision db1a88a5acc0df7d8a941aa772ef63c8941d1893)
1*761e3c10SMatheus Branco Borella /*
2*761e3c10SMatheus Branco Borella  * External interruption test. This test is structured in such a way that it
3*761e3c10SMatheus Branco Borella  * passes the cases that require it to exit, but we can make it enter an
4*761e3c10SMatheus Branco Borella  * infinite loop from GDB.
5*761e3c10SMatheus Branco Borella  *
6*761e3c10SMatheus Branco Borella  * We don't have the benefit of libc, just builtin C primitives and
7*761e3c10SMatheus Branco Borella  * whatever is in minilib.
8*761e3c10SMatheus Branco Borella  */
9*761e3c10SMatheus Branco Borella 
10*761e3c10SMatheus Branco Borella #include <minilib.h>
11*761e3c10SMatheus Branco Borella 
loop(void)12*761e3c10SMatheus Branco Borella void loop(void)
13*761e3c10SMatheus Branco Borella {
14*761e3c10SMatheus Branco Borella     do {
15*761e3c10SMatheus Branco Borella         /*
16*761e3c10SMatheus Branco Borella          * Loop forever. Just make sure the condition is always a constant
17*761e3c10SMatheus Branco Borella          * expression, so that this loop is not UB, as per the C
18*761e3c10SMatheus Branco Borella          * standard.
19*761e3c10SMatheus Branco Borella          */
20*761e3c10SMatheus Branco Borella     } while (1);
21*761e3c10SMatheus Branco Borella }
22*761e3c10SMatheus Branco Borella 
main(void)23*761e3c10SMatheus Branco Borella int main(void)
24*761e3c10SMatheus Branco Borella {
25*761e3c10SMatheus Branco Borella     return 0;
26*761e3c10SMatheus Branco Borella }
27*761e3c10SMatheus Branco Borella 
28*761e3c10SMatheus Branco Borella 
29