2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr24626-2.c
blobe48d3b31c4b3a65f8e919922335176af7138d655
1 /* { dg-do compile } */
3 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
4 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
5 typedef u_int32_t db_pgno_t;
6 typedef struct __db DB;
7 typedef struct __db_env DB_ENV;
8 typedef struct __db_mpoolfile DB_MPOOLFILE;
9 typedef struct __dbc DBC;
10 struct __db {
11 DB_MPOOLFILE *mpf;
12 db_pgno_t meta_pgno;
13 struct __cq_aq {
14 } s_links;
16 struct __db_env {
17 struct {
18 } xa_txn;
19 u_int32_t flags;
21 typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
22 typedef struct __dbpginfo {
23 u_int8_t type;
24 } PAGE;
25 int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
26 DB *mdbp, *sdbp;
28 DB_ENV *dbenv;
29 DBC *dbc, *ndbc;
30 PAGE *p, *r;
31 int modify, ret, t_ret;
32 if ((ret = __db_cursor(mdbp, txn, &dbc,
33 (((dbenv)->flags & (0x0000002))
34 && modify) ? 35 : 0)) != 0)
35 goto err;
36 switch (action) {
37 case MU_REMOVE:
38 if ((ret = __memp_fget(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0)
39 goto err;
40 if ((((PAGE *)p)->type) == 9) {
41 if ((ret = __db_free(dbc, r)) != 0) { }
43 if ((ret = __db_free(dbc, p)) != 0) {
44 p = ((void *)0);
45 goto err;
47 p = ((void *)0);
49 err:
50 if (ndbc != ((void *)0) && (t_ret = __db_c_close(ndbc)) != 0 && ret == 0)
51 ret = t_ret;
52 return (ret);