2 20011008-1.c from the execute part of the gcc torture tests.
9 #pragma disable_warning 85
12 // Hmm, this test uses identifiers tarting in __, which are reserved for the implementation. We probably should rename them. Philipp
16 #if !defined(__SDCC_pdk14) // Lack of memory
17 typedef uint32_t u_int32_t
;
18 typedef uint8_t u_int8_t
;
27 struct __db_lsn
; typedef struct __db_lsn DB_LSN
;
32 struct __db_txnlist
; typedef struct __db_txnlist DB_TXNLIST
;
36 struct { struct __db_txnlist
*le_next
; struct __db_txnlist
**le_prev
; } links
;
67 int log_compare (const DB_LSN
*a
, const DB_LSN
*b
)
73 __db_txnlist_lsnadd(int val
, DB_TXNLIST
*elp
, DB_LSN
*lsnp
, u_int32_t flags
)
77 for (i
= 0; i
< (!(flags
& (0x1)) ? 1 : elp
->u
.l
.ntxns
); i
++)
82 for (__j
= 0; __j
< elp
->u
.l
.ntxns
- 1; __j
++)
83 if (log_compare(&elp
->u
.l
.lsn_array
[__j
], &elp
->u
.l
.lsn_array
[__j
+ 1]) < 0)
85 __tmp
= elp
->u
.l
.lsn_array
[__j
];
86 elp
->u
.l
.lsn_array
[__j
] = elp
->u
.l
.lsn_array
[__j
+ 1];
87 elp
->u
.l
.lsn_array
[__j
+ 1] = __tmp
;
91 *lsnp
= elp
->u
.l
.lsn_array
[0];
96 #define VLEN 5 // NOTE: reduced from 1235 to 5 for use with SDCC
99 testTortureExecute (void)
101 #if !(defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Lack of memory
103 DB_LSN lsn
, lsn_a
[VLEN
];
105 el
.u
.l
.ntxns
= VLEN
-1;
106 el
.u
.l
.lsn_array
= lsn_a
;
108 if (__db_txnlist_lsnadd (0, &el
, &lsn
, 0) != 1)
111 if (__db_txnlist_lsnadd (0, &el
, &lsn
, 1) != VLEN
-1)