Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/lto/pr90939_0.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // PR ipa/90939 | |
2 // { dg-lto-do link } | |
3 // { dg-lto-options { { -flto -O3 } } } | |
4 | |
5 | |
6 typedef char uint8_t; | |
7 template <class T> class A { | |
8 public: | |
9 A(T *); | |
10 }; | |
11 template <typename Derived, typename Base> const Derived &To(Base &p1) { | |
12 return static_cast<const Derived &>(p1); | |
13 } | |
14 class H; | |
15 template <typename, typename Base> const H *To(Base *p1) { | |
16 return p1 ? &To<H>(*p1) : nullptr; | |
17 } | |
18 enum TextDirection : uint8_t; | |
19 enum WritingMode : unsigned; | |
20 class B { | |
21 public: | |
22 WritingMode m_fn1(); | |
23 }; | |
24 class C { | |
25 public: | |
26 int &m_fn2(); | |
27 }; | |
28 class D { double d;}; | |
29 class H : public D {}; | |
30 class F { | |
31 public: | |
32 F(C, A<const int>, B *, WritingMode, TextDirection); | |
33 }; | |
34 | |
35 class G { | |
36 public: | |
37 C NGLayoutAlgorithm_node; | |
38 B NGLayoutAlgorithm_space; | |
39 TextDirection NGLayoutAlgorithm_direction; | |
40 H NGLayoutAlgorithm_break_token; | |
41 G(A<const int> p1) __attribute__((noinline)) | |
42 : break_token_(&NGLayoutAlgorithm_break_token), | |
43 container_builder_(NGLayoutAlgorithm_node, p1, &NGLayoutAlgorithm_space, | |
44 NGLayoutAlgorithm_space.m_fn1(), | |
45 NGLayoutAlgorithm_direction) {} | |
46 G(C p1, const H *) : G(&p1.m_fn2()) {} | |
47 A<H> break_token_; | |
48 F container_builder_; | |
49 }; | |
50 | |
51 class I : G { | |
52 public: | |
53 I(const D *) __attribute__((noinline)); | |
54 }; | |
55 C a; | |
56 I::I(const D *p1) : G(a, To<H>(p1)) {} | |
57 | |
58 D gd[10]; | |
59 | |
60 int main (int argc, char *argv[]) | |
61 { | |
62 I i(&(gd[argc%2])); | |
63 return 0; | |
64 } |