From: sirl Date: Mon, 8 Oct 2001 21:01:03 +0000 (+0000) Subject: 2001-10-08 Franz Sirl X-Git-Tag: upstream/4.9.2~91722 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4480f1aba4f4806026759d156b5239a37d77fe5a;p=platform%2Fupstream%2Flinaro-gcc.git 2001-10-08 Franz Sirl * gcc.c-torture/execute/20011008-3.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46097 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index decc7d1..d608e91 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-10-08 Franz Sirl + + * gcc.c-torture/execute/20011008-3.c: New. + 2001-10-08 DJ Delorie * gcc.dg/20011008-1.c: New. diff --git a/gcc/testsuite/gcc.c-torture/execute/20011008-3.c b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c new file mode 100644 index 0000000..73b569f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c @@ -0,0 +1,98 @@ +extern void exit (int); +extern void abort (void); + +typedef unsigned int u_int32_t; +typedef unsigned char u_int8_t; +typedef int int32_t; + +typedef enum { + TXNLIST_DELETE, + TXNLIST_LSN, + TXNLIST_TXNID, + TXNLIST_PGNO +} db_txnlist_type; + +struct __db_lsn; typedef struct __db_lsn DB_LSN; +struct __db_lsn { + u_int32_t file; + u_int32_t offset; +}; +struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; + +struct __db_txnlist { + db_txnlist_type type; + struct { struct __db_txnlist *le_next; struct __db_txnlist **le_prev; } links; + union { + struct { + u_int32_t txnid; + int32_t generation; + int32_t aborted; + } t; + struct { + + + u_int32_t flags; + int32_t fileid; + u_int32_t count; + char *fname; + } d; + struct { + int32_t ntxns; + int32_t maxn; + DB_LSN *lsn_array; + } l; + struct { + int32_t nentries; + int32_t maxentry; + char *fname; + int32_t fileid; + void *pgno_array; + u_int8_t uid[20]; + } p; + } u; +}; + +int log_compare (const DB_LSN *a, const DB_LSN *b) +{ + return 1; +} + + +int +__db_txnlist_lsnadd(int val, DB_TXNLIST *elp, DB_LSN *lsnp, u_int32_t flags) +{ + int i; + + for (i = 0; i < (!(flags & (0x1)) ? 1 : elp->u.l.ntxns); i++) + { + int __j; + DB_LSN __tmp; + val++; + for (__j = 0; __j < elp->u.l.ntxns - 1; __j++) + if (log_compare(&elp->u.l.lsn_array[__j], &elp->u.l.lsn_array[__j + 1]) < 0) + { + __tmp = elp->u.l.lsn_array[__j]; + elp->u.l.lsn_array[__j] = elp->u.l.lsn_array[__j + 1]; + elp->u.l.lsn_array[__j + 1] = __tmp; + } + } + + *lsnp = elp->u.l.lsn_array[0]; + return val; +} + +int main (void) +{ + DB_TXNLIST el; + DB_LSN lsn; + + el.u.l.ntxns = 1234; + + if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1) + abort (); + + if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != 1234) + abort (); + + exit (0); +}