| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mrecip=all -mfrecipe -mabi=lp64d -march=loongarch64 -mfpu=64 -msimd=lasx -Ofast" } */ |
| 3 |
|
| 4 |
typedef long unsigned int STRLEN; |
| 5 |
typedef struct sv SV; |
| 6 |
struct sv |
| 7 |
{ |
| 8 |
void *sv_any; |
| 9 |
unsigned int sv_refcnt; |
| 10 |
unsigned int sv_flags; |
| 11 |
}; |
| 12 |
typedef struct xpv XPV; |
| 13 |
struct xpv |
| 14 |
{ |
| 15 |
char *xpv_pv; |
| 16 |
STRLEN xpv_cur; |
| 17 |
STRLEN xpv_len; |
| 18 |
}; |
| 19 |
typedef unsigned long UV; |
| 20 |
extern char *PL_bufend; |
| 21 |
extern char *d; |
| 22 |
SV *Perl_newSV (STRLEN len); |
| 23 |
|
| 24 |
char * |
| 25 |
S_scan_const (char *start) |
| 26 |
{ |
| 27 |
register char *send = PL_bufend; |
| 28 |
SV *sv = Perl_newSV (send - start); |
| 29 |
register char *s = start; |
| 30 |
UV uv; |
| 31 |
|
| 32 |
while (s < send) |
| 33 |
{ |
| 34 |
if (!(((UV)(uv)) < 0x80)) |
| 35 |
{ |
| 36 |
int hicount = 0; |
| 37 |
unsigned char *c; |
| 38 |
for (c = (unsigned char *)((XPV *)(sv)->sv_any)->xpv_pv; |
| 39 |
c < (unsigned char *)d; c++) |
| 40 |
{ |
| 41 |
if (!(((UV)(*c)) < 0x80)) |
| 42 |
{ |
| 43 |
hicount++; |
| 44 |
} |
| 45 |
} |
| 46 |
d += hicount; |
| 47 |
*d++ = (char)uv; |
| 48 |
} |
| 49 |
|
| 50 |
s++; |
| 51 |
} |
| 52 |
|
| 53 |
return s; |
| 54 |
} |