Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr45572-1.C

raw
1 // { dg-do compile }
2 // { dg-options "-finline-small-functions -findirect-inlining -finline-functions -O" }
3
4 extern "C" {
5 typedef long unsigned int size_t;
6 typedef long int __ssize_t;
7 typedef struct _IO_FILE FILE;
8 typedef struct
9 {
10 } __mbstate_t;
11 extern __inline __attribute__ ((__gnu_inline__)) int
12 fgetc_unlocked (FILE *__fp)
13 {
14 return 0;
15 }
16 extern __inline __attribute__ ((__gnu_inline__)) int
17 putc_unlocked (int __c, FILE *__stream)
18 {
19 return 0;
20 }
21 extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
22 getline (char **__lineptr, size_t *__n, FILE *__stream)
23 {
24 return 0;
25 }
26 extern __inline __attribute__ ((__gnu_inline__)) int
27 ferror_unlocked (FILE *__stream) throw ()
28 {
29 return 0;
30 }
31 }
32 typedef struct
33 {} __mpf_struct;
34 typedef __mpf_struct mpf_t[1];
35 typedef const __mpf_struct *mpf_srcptr;
36 typedef __mpf_struct *mpf_ptr;
37 extern "C" {
38 void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);
39 }
40 class _knumber
41 {
42 public:
43 enum NumType {SpecialType, IntegerType, FractionType, FloatType};
44 virtual NumType type(void) const = 0;
45 virtual _knumber * add(_knumber const & arg2) const = 0;
46 virtual operator long int(void) const = 0;
47 };
48 class _knumfloat : public _knumber
49 {
50 _knumfloat(double num = 1.0)
51 ;
52 virtual NumType type(void) const ;
53 virtual _knumber * add(_knumber const & arg2) const;
54 virtual operator long int (void) const;
55 mpf_t _mpf;
56 };
57 _knumber *_knumfloat::add(_knumber const & arg2) const
58 {
59 if (arg2.type() == SpecialType)
60 return arg2.add(*this);
61 {
62 _knumfloat tmp_num(arg2);
63 return tmp_num.add(*this);
64 }
65 _knumfloat * tmp_num = new _knumfloat();
66 __gmpf_add(tmp_num->_mpf, _mpf,
67 dynamic_cast<_knumfloat const &>(arg2)._mpf);
68 }