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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.warn/] [inline.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// { dg-options "-ansi -pedantic-errors -Winline -O1" }
3
 
4
// Copyright (C) 2000 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 9 Mar 2000 
6
 
7
// derived from a bug report by Benjamin Kosnik 
8
 
9
// __FUNCTION__ was erroneously causing us to issue a `cannot inline'
10
// diagnostic, even though we'd (a) inlined it, (b) been forced to issue an
11
// out of line body by taking it's address, (c) not used __FUNCTION__.
12
 
13
inline void wibble ()
14
{}
15
 
16
inline void wobble ()
17
{}                          // { dg-bogus "" } cannot inline
18
 
19
void bar (void (*)());
20
 
21
void bar1 ()
22
{
23
  wibble ();                // can be inlined
24
  void (*ptr) () = wobble;  // force out of line issue
25
 
26
  bar (ptr);                // make sure we make use of it
27
}
28
 
29
struct B
30
{
31
  void mwibble ()
32
  {}
33
  void mwobble ()
34
  {}                        // { dg-bogus "" } cannot inline
35
 
36
  static void swibble ()
37
  {}
38
  static void swobble ()
39
  {}                        // { dg-bogus "" } cannot inline
40
};
41
 
42
void bar (void (B::*)());
43
 
44
void bar2 ()
45
{
46
  B::swibble ();                  // can be inlined
47
  void (*ptr) () = &B::swobble;   // force out of line issue
48
 
49
  bar (ptr);                      // make sure we make use of it
50
}
51
 
52
void bar3 (B *b)
53
{
54
  b->mwibble ();                    // can be inlined
55
  void (B::*ptr) () = &B::mwobble;  // force out of line issue
56
 
57
  bar (ptr);                        // make sure we make use of it
58
}
59
 
60
struct C
61
{
62
  virtual void vwobble ()
63
  {}                                // { dg-bogus "" } cannot inline
64
};
65
 
66
void bar4 ()
67
{
68
  C c;                              // force issue of C's vtable etc
69
}

powered by: WebSVN 2.1.0

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