Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / pic-symrefplus.c
blob406568c9d918680809830eb8fa2fecda062b39c1
1 /* { dg-options "-O2 -mcmodel=small -fPIC -fno-builtin" } */
2 /* { dg-do compile } */
4 typedef long unsigned int size_t;
5 enum
7 __LC_TIME = 2,
8 };
9 enum
11 ABDAY_1 = (((__LC_TIME) << 16) | (0)),
12 DAY_1,
13 ABMON_1,
14 MON_1,
15 D_T_FMT,
17 typedef struct __locale_struct
19 struct locale_data *__locales[13];
20 } *__locale_t;
21 struct tm
23 int tm_sec;
24 int tm_min;
25 int tm_hour;
27 struct locale_data
29 const char *name;
30 struct
32 const char *string;
34 values [];
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);
40 char *
41 __strptime_internal (rp, fmt, tmp, statep , locale)
42 const char *rp;
43 const char *fmt;
44 __locale_t locale;
45 void *statep;
46 int tmp;
48 struct locale_data *const current = locale->__locales[__LC_TIME];
49 const char *rp_backup;
50 const char *rp_longest;
51 int cnt;
52 size_t val;
53 enum ptime_locale_status { not, loc, raw } decided_longest;
54 struct __strptime_state
56 enum ptime_locale_status decided : 2;
57 } s;
58 struct tm tmb;
59 struct tm *tm;
60 if (statep == ((void *)0))
62 memset (&s, 0, sizeof (s));
65 tm = &tmb;
67 while (*fmt != '\0')
69 if (*fmt != '%')
71 if (*fmt++ != *rp++) return ((void *)0);
72 continue;
74 if (statep != ((void *)0))
76 ++fmt;
78 rp_backup = rp;
79 switch (*fmt++)
81 case '%':
82 for (cnt = 0; cnt < 7; ++cnt)
84 const char *trp;
85 if (s.decided !=raw)
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; })
88 && trp > rp_longest)
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; })
92 && trp > rp_longest)
96 if (s.decided != loc
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; }))
98 && trp > rp_longest)
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)))
105 const char *trp;
106 if (s.decided != loc
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; }))
108 && trp > rp_longest)
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)))
114 case 'c':
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)))
118 rp = rp_backup;
121 case 'C':
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);
123 case 'F':
124 if (!(*("%Y-%m-%d") != '\0' && (rp = __strptime_internal (rp, ("%Y-%m-%d"), tm, &s , locale)) != ((void *)0)))
125 tm->tm_hour = val % 12;
129 char *
130 __strptime_l (buf, format, tm , locale)
131 int buf;
132 int format;
133 int tm;
134 int locale;