OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [scal-to-vec1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wno-long-long" } */
3
/* { dg-options "-Wno-long-long -mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */
4
 
5
#define vector(elcount, type)  \
6
__attribute__((vector_size((elcount)*sizeof(type)))) type
7
 
8
#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
9
 
10
 
11
extern float sfl;
12
extern int   sint;
13
extern long long sll;
14
 
15
int main (int argc, char *argv[]) {
16
    vector(8, short) v0 = {argc, 1,2,3,4,5,6,7};
17
    vector(8, short) v1;
18
 
19
    vector(4, float) f0 = {1., 2., 3., 4.};
20
    vector(4, float) f1, f2;
21
 
22
    vector(4, int) i0 = {1,2,3,4};
23
    vector(4, int) i1, i2;
24
 
25
 
26
    int     i = 12;
27
    double  d = 3.;
28
 
29
    v1 = i + v0;        /* { dg-error "conversion of scalar to vector" } */
30
    v1 = 99999 + v0;    /* { dg-error "conversion of scalar to vector" } */
31
 
32
    f1 = d + f0;        /* { dg-error "conversion of scalar to vector" } */
33
    f1 = 1.3 + f0;      /* { dg-error "conversion of scalar to vector" } */
34
    f1 = sll + f0;      /* { dg-error "conversion of scalar to vector" } */
35
    f1 = ((int)998769576) + f0; /* { dg-error "conversion of scalar to vector" } */
36
 
37
    /* convert.c should take care of this.  */
38
    i1 = sfl + i0;      /* { dg-error "can't convert value to a vector" } */
39
    i1 = 1.5 + i0;      /* { dg-error "can't convert value to a vector" } */
40
    v1 = d + v0;        /* { dg-error "can't convert value to a vector" } */
41
 
42
    return 0;
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.