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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR target/12301
2
// Origin: Colin Hirsch 
3
// Testcase by Christian Ehrhardt 
4
 
5
// This used to fail on SPARC because the reorg pass moved an insn
6
// across a function call that can throw internally, in order to put
7
// it in a delay slot.
8
 
9
// { dg-do run }
10
// { dg-options "-O" }
11
 
12
struct S{
13
  char *c;
14
  char data[100];
15
  S () : c (data) {};
16
  S (const S& s) {
17
    c = data;
18
    data[0] = s.c[0];
19
  }
20
};
21
 
22
S real_cast ()
23
{
24
  throw 3;
25
}
26
 
27
S cast_helper(S& debug)
28
{
29
  try {
30
    return real_cast();
31
  }
32
  catch (int e) {
33
    throw debug;
34
  }
35
}
36
 
37
int main()
38
{
39
  S tmp;
40
 
41
  try {
42
    cast_helper (tmp);
43
  }
44
  catch (S& e) {}
45
 
46
  return 0;
47
}

powered by: WebSVN 2.1.0

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