blob: 14181c25e7d27528363f8291bb0b1a7237d7a84f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-O1 -mcpu=power7" } */
extern void abort (void);
typedef long long T;
typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
vl_t
buggy_func (T x)
{
vl_t w;
T *p = (T *)&w;
p[0] = p[1] = x;
return w;
}
int
main(void)
{
vl_t rval;
T *pl;
pl = (T *) &rval;
rval = buggy_func (2);
if (pl[0] != 2 || pl[1] != 2)
abort ();
return 0;
}
|