OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.dg/] [eh/] [comdat1.C] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR target/29487
2
// { dg-do link }
3
// { dg-options "-O2" }
4
 
5
/* This function is not defined.  The compiler should optimize away
6
   all calls to it.  */
7
extern void undefined () throw ();
8
 
9
extern void f1();
10
 
11
inline void f2() {
12
  f1();
13
}
14
 
15
/* This function will be COMDAT if not inlined.  */
16
inline void f1() {}
17
 
18
/* This function will be COMDAT.  */
19
template 
20
void f3() {
21
  if (false)
22
    throw 3;
23
}
24
 
25
inline void f4() {
26
  if (false)
27
    throw 7;
28
}
29
 
30
int main () {
31
  try {
32
    f1();
33
    f2();
34
    f3();
35
    f4();
36
  } catch (...) {
37
    /* The compiler should recognize that none of the functions above
38
       can throw exceptions, and therefore remove this code as
39
       unreachable.  */
40
    undefined ();
41
  }
42
}

powered by: WebSVN 2.1.0

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