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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [attr-aligned01.C] - Blame information for rev 696

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/48138
2
 
3
#define ALIGNED(x) __attribute__((aligned(x)))
4
#define SA(X) int ar[(X)?1:-1];
5
 
6
template
7
void type_alignment(const T&) {
8
  struct { char c; T t; } s;
9
  SA((char*)&s.t - (char*)&s.c == 1);
10
}
11
 
12
template  struct A { char c; T t; };
13
 
14
int main() {
15
  typedef char unaligned[15];
16
  typedef char aligned[15] ALIGNED(8);
17
 
18
  A a;                  // { dg-warning "ignoring attributes" }
19
 
20
  SA((char*)&a.t - (char*)&a.c == 1);
21
 
22
  aligned z;
23
  type_alignment(z);            // { dg-warning "ignoring attributes" "" { xfail *-*-* } }
24
  type_alignment(z); // { dg-warning "ignoring attributes" "" { xfail *-*-* } }
25
}

powered by: WebSVN 2.1.0

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