1 /* { dg-options "-O2 -mcmodel=small -fPIC -fno-builtin" } */
2 /* { dg-do compile } */
4 typedef long unsigned int size_t;
11 ABDAY_1
= (((__LC_TIME
) << 16) | (0)),
17 typedef struct __locale_struct
19 struct locale_data
*__locales
[13];
36 extern const struct locale_data _nl_C_LC_TIME
__attribute__ ((visibility ("hidden")));
37 extern void *memset (void *s
, int c
, size_t n
);
38 extern size_t strlen (const char *s
);
39 extern int __strncasecmp_l (const char *s1
, const char *s2
, size_t n
, __locale_t locale
);
41 __strptime_internal (rp
, fmt
, tmp
, statep
, locale
)
48 struct locale_data
*const current
= locale
->__locales
[__LC_TIME
];
49 const char *rp_backup
;
50 const char *rp_longest
;
53 enum ptime_locale_status
{ not, loc
, raw
} decided_longest
;
54 struct __strptime_state
56 enum ptime_locale_status decided
: 2;
60 if (statep
== ((void *)0))
62 memset (&s
, 0, sizeof (s
));
71 if (*fmt
++ != *rp
++) return ((void *)0);
74 if (statep
!= ((void *)0))
82 for (cnt
= 0; cnt
< 7; ++cnt
)
87 if (({ size_t len
= strlen ((current
->values
[((int) (DAY_1
+ cnt
) & 0xffff)].string
)); int result
= __strncasecmp_l (((current
->values
[((int) (DAY_1
+ cnt
) & 0xffff)].string
)), (trp
), len
, locale
) == 0; if (result
) (trp
) += len
; result
; })
91 if (({ size_t len
= strlen ((current
->values
[((int) (ABDAY_1
+ cnt
) & 0xffff)].string
)); int result
= __strncasecmp_l (((current
->values
[((int) (ABDAY_1
+ cnt
) & 0xffff)].string
)), (trp
), len
, locale
) == 0; if (result
) (trp
) += len
; result
; })
97 && (((trp
= rp
, ({ size_t len
= strlen ((&_nl_C_LC_TIME
.values
[((int) (DAY_1
) & 0xffff)].string
)[cnt
]); int result
= __strncasecmp_l (((&_nl_C_LC_TIME
.values
[((int) (DAY_1
) & 0xffff)].string
)[cnt
]), (trp
), len
, locale
) == 0; if (result
) (trp
) += len
; result
; }))
99 || ((trp
= rp
, ({ size_t len
= strlen ((&_nl_C_LC_TIME
.values
[((int) (ABDAY_1
) & 0xffff)].string
)[cnt
]); int result
= __strncasecmp_l (((&_nl_C_LC_TIME
.values
[((int) (ABDAY_1
) & 0xffff)].string
)[cnt
]), (rp
), len
, locale
) == 0; if (result
) (rp
) += len
; result
; }))
100 && trp
> rp_longest
)))
107 && (((trp
= rp
, ({ size_t len
= strlen ((&_nl_C_LC_TIME
.values
[((int) (MON_1
) & 0xffff)].string
)[cnt
]); int result
= __strncasecmp_l (((&_nl_C_LC_TIME
.values
[((int) (MON_1
) & 0xffff)].string
)[cnt
]), (trp
), len
, locale
) == 0; if (result
) (trp
) += len
; result
; }))
109 || ((trp
= rp
, ({ size_t len
= strlen ((&_nl_C_LC_TIME
.values
[((int) (ABMON_1
) & 0xffff)].string
)[cnt
]); int result
= __strncasecmp_l (((&_nl_C_LC_TIME
.values
[((int) (ABMON_1
) & 0xffff)].string
)[cnt
]), (trp
), len
, locale
) == 0; if (result
) (trp
) += len
; result
; }))
110 && trp
> rp_longest
)))
116 if (!(*((current
->values
[((int) (D_T_FMT
) & 0xffff)].string
)) != '\0' && (rp
= __strptime_internal (rp
, ((current
->values
[((int) (D_T_FMT
) & 0xffff)].string
)), tm
, &s
, locale
)) != ((void *)0)))
122 do { int __n
= 2; val
= 0; while (*rp
== ' ') ++rp
; if (*rp
< '0' || *rp
> '9') return ((void *)0); do { val
*= 10; val
+= *rp
++ - '0'; } while (--__n
> 0 && val
* 10 <= 99 && *rp
>= '0' && *rp
<= '9'); if (val
< 0 || val
> 99) return ((void *)0); } while (0);
124 if (!(*("%Y-%m-%d") != '\0' && (rp
= __strptime_internal (rp
, ("%Y-%m-%d"), tm
, &s
, locale
)) != ((void *)0)))
125 tm
->tm_hour
= val
% 12;
130 __strptime_l (buf
, format
, tm
, locale
)