| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mdejagnu-cpu=power8 -mvsx" } */ |
| 3 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 4 |
|
| 5 |
#include <stdlib.h> |
| 6 |
#include <stdio.h> |
| 7 |
#include <altivec.h> |
| 8 |
|
| 9 |
vector double retd; |
| 10 |
vector float retf; |
| 11 |
vector signed int retsi; |
| 12 |
|
| 13 |
void test_int(vector signed int a, const int b) |
| 14 |
{ |
| 15 |
retf = vec_ctf(a,b); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 16 |
retf = vec_ctf(a,-1); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 17 |
retf = vec_ctf(a,-31); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 18 |
retf = vec_ctf(a,-32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 19 |
retf = vec_ctf(a,1); |
| 20 |
retf = vec_ctf(a,31); |
| 21 |
retf = vec_ctf(a,32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 22 |
retf = vec_ctf(a,42); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 23 |
} |
| 24 |
|
| 25 |
void test_uint(vector unsigned int a, const int b) |
| 26 |
{ |
| 27 |
retf = vec_ctf(a,b); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 28 |
retf = vec_ctf(a,-1); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 29 |
retf = vec_ctf(a,-31); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 30 |
retf = vec_ctf(a,-32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 31 |
retf = vec_ctf(a,1); |
| 32 |
retf = vec_ctf(a,31); |
| 33 |
retf = vec_ctf(a,32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 34 |
retf = vec_ctf(a,42); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 35 |
} |
| 36 |
|
| 37 |
void test_longlong(vector signed long long a, const int b,int x) |
| 38 |
{ |
| 39 |
retd = vec_ctf(a,b); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 40 |
retd = vec_ctf(a,-1); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 41 |
retd = vec_ctf(a,-31); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 42 |
retd = vec_ctf(a,-32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 43 |
retd = vec_ctf(a,1); |
| 44 |
retd = vec_ctf(a,31); |
| 45 |
retd = vec_ctf(a,32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 46 |
retd = vec_ctf(a,42); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 47 |
} |
| 48 |
|
| 49 |
void test_ulonglong(vector unsigned long long a, const int b,int x) |
| 50 |
{ |
| 51 |
retd = vec_ctf(a,b); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 52 |
retd = vec_ctf(a,-1); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 53 |
retd = vec_ctf(a,-31); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 54 |
retd = vec_ctf(a,-32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 55 |
retd = vec_ctf(a,1); |
| 56 |
retd = vec_ctf(a,31); |
| 57 |
retd = vec_ctf(a,32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 58 |
retd = vec_ctf(a,42); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
void test_cts_1(vector float a, const int b) |
| 63 |
{ |
| 64 |
retsi = vec_cts(a,b); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 65 |
retsi = vec_cts(a,-1); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 66 |
retsi = vec_cts(a,-31); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 67 |
retsi = vec_cts(a,-32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 68 |
retsi = vec_cts(a,1); |
| 69 |
retsi = vec_cts(a,31); |
| 70 |
retsi = vec_cts(a,32); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 71 |
retsi = vec_cts(a,42); /* { dg-error "argument 2 must be a literal between 0 and 31, inclusive" } */ |
| 72 |
} |
| 73 |
|