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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic73.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options "-std=gnu++0x" }
3
struct A {};
4
struct B {};
5
struct C {};
6
 
7
template void f(int idx) throw(Exceptions...) {
8
  if (idx == 0) throw A();
9
  else if (idx == 1) throw B();
10
  else if (idx == 2) throw C();
11
}
12
 
13
extern "C" void abort();
14
 
15
int main()
16
{
17
  try {
18
    f(0);
19
    abort();
20
  } catch (A) {
21
  }
22
  try {
23
    f(1);
24
    abort();
25
  } catch (B) {
26
  }
27
  try {
28
    f(2);
29
    abort();
30
  } catch (C) {
31
  }
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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