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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [comdat1.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 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.