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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [attribute-test-1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { 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
/* Ignore a warning that is irrelevant to the purpose of this test.  */
38
/* { dg-prune-output ".*GCC vector returned by reference.*" } */

powered by: WebSVN 2.1.0

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