* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 20040708-1.c
blob4a553917e44525d58be02fabb2da954d4936c664
1 /* PR rtl-optimization/16199 */
2 /* Origin: Olaf Klein <oklein@smallo.ruhr.de> */
4 typedef enum {
5 APR_LOCK_FCNTL,
6 APR_LOCK_FLOCK,
7 APR_LOCK_SYSVSEM,
8 APR_LOCK_PROC_PTHREAD,
9 APR_LOCK_POSIXSEM,
10 APR_LOCK_DEFAULT
11 } apr_lockmech_e;
13 struct apr_proc_mutex_unix_lock_methods_t {
14 unsigned int flags;
15 const char *name;
18 typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t;
20 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods;
22 struct apr_proc_mutex_t {
23 const apr_proc_mutex_unix_lock_methods_t *inter_meth;
24 int curr_locked;
25 char *fname;
28 typedef struct apr_proc_mutex_t apr_proc_mutex_t;
30 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods;
32 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods;
34 static int proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech)
36 switch (mech) {
37 case APR_LOCK_FCNTL:
38 new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods;
39 break;
40 case APR_LOCK_FLOCK:
41 return ((20000 + 50000) + 23);
42 break;
43 case APR_LOCK_SYSVSEM:
44 new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods;
45 break;
46 case APR_LOCK_POSIXSEM:
47 return ((20000 + 50000) + 23);
48 break;
49 case APR_LOCK_PROC_PTHREAD:
50 new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods;
51 break;
52 case APR_LOCK_DEFAULT:
53 new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods;
54 break;
55 default:
56 return ((20000 + 50000) + 23);
58 return 0;
61 const char* apr_proc_mutex_defname(void)
63 apr_proc_mutex_t mutex;
65 if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT) != 0) {
66 return "unknown";