Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-ld-misc.c
blob4b86a81337c5b3bd0b9905f6c0fcca2c81ef9382
1 /* Verify that overloaded built-ins for vec_ld with
2 structure pointer / double inputs produce the right code. */
4 /* This test is to ensure that when a cast is associated with arg1 on a
5 call to vec_ld (arg0, arg1), that the arg1 type is properly handled
6 through the gimple folding code.
7 We want something like this:
8 D.2736 = MEM[(voidD.44 *)D.2739];
9 We specifically do not want 'struct S' showing up:
10 D.3212 = MEM[(struct S *)D.3215];
13 /* { dg-do compile { target lp64 } } */
14 /* { dg-require-effective-target powerpc_vsx_ok } */
15 /* { dg-options "-mvsx -O2 -fdump-tree-gimple" } */
17 #include <altivec.h>
18 #include <stdio.h>
20 struct S {
21 vector int *i1,*i2;
22 vector long long *ll1;
23 vector double *vd1;
24 vector double *vd2;
25 vector double *vd3;
26 vector double *vd4;
29 vector double
30 testld_struct1 (long long ll1, struct S *p)
32 return __builtin_altivec_lvx_v2df (ll1, (double *)p);
35 vector double
36 testld_struct1b (long long ll1, struct S *p)
38 return vec_ld (ll1, (vector double *)p);
41 vector double
42 testld_struct2 (struct S *p)
44 return vec_ld (16, (vector double *)p);
47 vector double
48 testld_struct3 (struct S *p)
50 return vec_ld (16, (vector double *)p->vd2);
53 // We do not want the "struct S" reference to show up.
54 /* { dg-final { scan-tree-dump-times "MEM\[\(struct S *\)D.\[0-9\]+\]" 0 "gimple" } } */