Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-ptr-arith-1.c
blob3ac1cc47d48dd3f92fd1a71edcda7fb2b1be5980
1 /*
2 ptr-arith-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 const char *
12 f (const char *s, unsigned int i)
14 return &s[i + 3 - 1];
17 void
18 testTortureExecute (void)
20 const char *str = "abcdefghijkl";
21 const char *x2 = f (str, 12);
22 if (str + 14 != x2)
23 ASSERT (0);
24 return;