Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / bug1565152.c
1 /*
2     bug 1565152.c
3 */
4
5 #include <testfwk.h>
6
7 // no need to call this, it generates compiler error for xstack-auto
8 //   error 9: FATAL Compiler Internal Error
9
10 #if defined(SDCC_mcs51)
11 #include <8051.h>
12
13 unsigned int foo(void)
14 {
15         unsigned int i,j;
16         unsigned long l=0;
17
18         for (i=0;i<10;i++)
19         {
20                 j=SP; // any SFR would do to generate crash
21                 l+=j; 
22         } 
23         return 1; // <- it gives error on this line
24 }
25 #endif
26
27 void
28 testBug(void)
29 {
30         ASSERT(1);
31 }