| 1 |
/* Test function for pr96933-{3,4}.c run result verification. */ |
| 2 |
|
| 3 |
int |
| 4 |
main () |
| 5 |
{ |
| 6 |
unsigned char uc[16]; |
| 7 |
signed char sc[16]; |
| 8 |
|
| 9 |
for (int i = 0; i < 16; i++) |
| 10 |
{ |
| 11 |
uc[i] = (unsigned char) (i * 2 + 1); |
| 12 |
sc[i] = (signed char) ((i % 2 == 0) ? (i + 1) : -i); |
| 13 |
} |
| 14 |
|
| 15 |
vector unsigned char ucv |
| 16 |
= test_uchar (uc[0], uc[1], uc[2], uc[3], uc[4], uc[5], uc[6], uc[7], uc[8], |
| 17 |
uc[9], uc[10], uc[11], uc[12], uc[13], uc[14], uc[15]); |
| 18 |
vector signed char scv |
| 19 |
= test_schar (sc[0], sc[1], sc[2], sc[3], sc[4], sc[5], sc[6], sc[7], sc[8], |
| 20 |
sc[9], sc[10], sc[11], sc[12], sc[13], sc[14], sc[15]); |
| 21 |
|
| 22 |
for (int i = 0; i < 16; i++) |
| 23 |
{ |
| 24 |
unsigned char uexp = (unsigned char) (i * 2 + 1); |
| 25 |
signed char sexp = (signed char) ((i % 2 == 0) ? (i + 1) : -i); |
| 26 |
if (ucv[i] != uexp) |
| 27 |
abort (); |
| 28 |
if (scv[i] != sexp) |
| 29 |
abort (); |
| 30 |
} |
| 31 |
|
| 32 |
unsigned short us[8]; |
| 33 |
signed short ss[8]; |
| 34 |
for (int i = 0; i < 8; i++) |
| 35 |
{ |
| 36 |
us[i] = (unsigned short) (i * 2 + 1); |
| 37 |
ss[i] = (signed short) ((i % 2 == 0) ? (i + 1) : -i); |
| 38 |
} |
| 39 |
|
| 40 |
vector unsigned short usv |
| 41 |
= test_ushort (us[0], us[1], us[2], us[3], us[4], us[5], us[6], us[7]); |
| 42 |
vector signed short ssv |
| 43 |
= test_sshort (ss[0], ss[1], ss[2], ss[3], ss[4], ss[5], ss[6], ss[7]); |
| 44 |
|
| 45 |
for (int i = 0; i < 8; i++) |
| 46 |
{ |
| 47 |
unsigned short uexp = (unsigned short) (i * 2 + 1); |
| 48 |
signed short sexp = (signed short) ((i % 2 == 0) ? (i + 1) : -i); |
| 49 |
if (usv[i] != uexp) |
| 50 |
abort (); |
| 51 |
if (ssv[i] != sexp) |
| 52 |
abort (); |
| 53 |
} |
| 54 |
|
| 55 |
return 0; |
| 56 |
} |