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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [union1.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run }
2
 
3
extern "C" void abort ();
4
 
5
void g (char c)
6
{
7
  if (c != 'a')
8
    abort ();
9
}
10
 
11
void h (int i)
12
{
13
  if (i != 3)
14
    abort ();
15
}
16
 
17
template  void f(T const &t)
18
{
19
    union { char c; T t_; };
20
 
21
    c = 'a';
22
    g (c);
23
    t_ = 3;
24
    h (t_);
25
}
26
 
27
int main () {
28
  f (3);
29
}

powered by: WebSVN 2.1.0

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