OSDN Git Service

cp/ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / attribute-test-1.C
1 // { dg-do run }
2 // { dg-options "" }
3 // PR c++/13989
4
5 extern "C" void abort();
6
7 #define vector __attribute__((vector_size(16)))
8
9 struct Constants {
10    inline vector unsigned int deadbeef(void) const {
11        return (vector unsigned int){0xdeadbeef, 0xabababab, 0x55555555, 0x12345678};
12    };
13 };
14
15 inline vector unsigned int const_deadbeef(Constants &C)
16 {
17   return C.deadbeef();
18 }
19
20 union u {
21               unsigned int f[4];
22               vector unsigned int v;
23 } data;
24
25 int main()
26 {
27   Constants c;
28   data.v = const_deadbeef(c);
29   
30   if (data.f[0] != 0xdeadbeef || data.f[1] != 0xabababab 
31       || data.f[2] != 0x55555555 || data.f[3] != 0x12345678)
32     abort();
33
34   return 0;
35 }
36
37