1extern void *malloc(__SIZE_TYPE__); 2extern void abort(void); 3extern void free(void *); 4 5typedef struct SEntry 6{ 7 unsigned char num; 8} TEntry; 9 10typedef struct STable 11{ 12 TEntry data[2]; 13} TTable; 14 15TTable *init () 16{ 17 return malloc(sizeof(TTable)); 18} 19 20void 21expect_func (int a, unsigned char *b) __attribute__ ((noinline)); 22 23static inline void 24inlined_wrong (TEntry *entry_p, int flag); 25 26void 27inlined_wrong (TEntry *entry_p, int flag) 28{ 29 unsigned char index; 30 entry_p->num = 0; 31 32 if (flag == 0) 33 abort(); 34 35 for (index = 0; index < 1; index++) 36 entry_p->num++; 37 38 if (!entry_p->num) 39 { 40 abort(); 41 } 42} 43 44void 45expect_func (int a, unsigned char *b) 46{ 47 if (abs ((a == 0))) 48 abort (); 49 if (abs ((b == 0))) 50 abort (); 51} 52 53int 54main () 55{ 56 unsigned char index = 0; 57 TTable *table_p = init(); 58 TEntry work; 59 60 inlined_wrong (&(table_p->data[1]), 1); 61 expect_func (1, &index); 62 inlined_wrong (&work, 1); 63 64 free (table_p); 65 66 return 0; 67} 68 69