[AArch64/arm] PR testsuite/85326 Avoid C++ tests when C++ compiler not present
[official-gcc.git] / gcc / testsuite / g++.dg / lto / 20090221_0.C
blobccbe4533e289c21264eb25655278b542fa93a218
1 // { dg-lto-do assemble }
2 extern void some_function (const char *);
3 extern bool some_other_function ();
5 struct Foo
7  long long a;
8  int b;
9 };
11 bool Foo_eq(Foo x, Foo y)
13  return x.a == y.a && x.b == y.b;
16 struct Bar
18  Foo a;
19  int b;
22 struct Baz
24  Bar a;
25  Baz(Bar &a):a(a) { }
28 #pragma GCC diagnostic ignored "-Wreturn-type"
29 struct Zonk
31  Baz baz;
33  Bar func_1(const Bar & bar) {
34    if (Foo_eq(bar.a, baz.a.a) && bar.b == baz.a.b || some_other_function ())
35      return bar;
36  }
38  void func_2(const Baz & baz) {
39    func_1(baz.a);
40    some_function(__PRETTY_FUNCTION__);
41  }
44 void func() {
45  Bar bar;
46  Zonk *rep;
47  rep->func_1(bar);
48  rep->func_2(Baz(bar));
51 void foo ()
53   func();