1 /*
2    ptr-arith-1.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 const char *
f(const char * s,unsigned int i)12 f (const char *s, unsigned int i)
13 {
14   return &s[i + 3 - 1];
15 }
16 
17 void
testTortureExecute(void)18 testTortureExecute (void)
19 {
20   const char *str = "abcdefghijkl";
21   const char *x2 = f (str, 12);
22   if (str + 14 != x2)
23     ASSERT (0);
24   return;
25 }
26 
27