2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / call3.C
blob9aac7e2c050470d0bbcccf9db235edd266cca4ff
1 // { dg-do run }
2 // { dg-options "-O" }
4 struct Foo
6   Foo() : a(1), c('a') {}
7   short int a;
8   char c;
9 };
11 static Foo copy_foo(Foo) __attribute__((noinline, noclone));
13 static Foo copy_foo(Foo A)
15   return A;
18 struct Bar : Foo
20   Bar(Foo t) : Foo(copy_foo(t)) {}
23 Foo F;
25 int main (void)
27   Bar B (F);
29   if (B.a != 1 || B.c != 'a')
30     __builtin_abort ();
32   return 0;