2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / pic-symrefplus.c
blobf277a5285783959ec5c156dba50f02b6295eeda8
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 char *
38 __strptime_internal (rp, fmt, tmp, statep , locale)
39 const char *rp;
40 const char *fmt;
41 __locale_t locale;
42 void *statep;
44 struct locale_data *const current = locale->__locales[__LC_TIME];
45 const char *rp_backup;
46 const char *rp_longest;
47 int cnt;
48 size_t val;
49 enum ptime_locale_status { not, loc, raw } decided_longest;
50 struct __strptime_state
52 enum ptime_locale_status decided : 2;
53 } s;
54 struct tm tmb;
55 struct tm *tm;
56 if (statep == ((void *)0))
58 memset (&s, 0, sizeof (s));
61 tm = &tmb;
63 while (*fmt != '\0')
65 if (*fmt != '%')
67 if (*fmt++ != *rp++) return ((void *)0);
68 continue;
70 if (statep != ((void *)0))
72 ++fmt;
74 rp_backup = rp;
75 switch (*fmt++)
77 case '%':
78 for (cnt = 0; cnt < 7; ++cnt)
80 const char *trp;
81 if (s.decided !=raw)
83 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; })
84 && trp > rp_longest)
87 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; })
88 && trp > rp_longest)
92 if (s.decided != loc
93 && (((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; }))
94 && trp > rp_longest)
95 || ((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; }))
96 && trp > rp_longest)))
101 const char *trp;
102 if (s.decided != loc
103 && (((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; }))
104 && trp > rp_longest)
105 || ((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; }))
106 && trp > rp_longest)))
110 case 'c':
112 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)))
114 rp = rp_backup;
117 case 'C':
118 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);
119 case 'F':
120 if (!(*("%Y-%m-%d") != '\0' && (rp = __strptime_internal (rp, ("%Y-%m-%d"), tm, &s , locale)) != ((void *)0)))
121 tm->tm_hour = val % 12;
125 char *
126 __strptime_l (buf, format, tm , locale)