2 // Test for the named return value optimization with inlining.
3 // Contributed by Jakub Jelinek <jakub@redhat.com>.
7 enum E { E0, E1, E2, E3 };
12 bool s1 : 1, s2 : 1, s3 : 1, s4 : 1, s5 : 1, s6 : 1;
17 S::S() : s1 (true), s2 (false), s0 (E1), s3 (true), s4 (false),
18 s5 (true), s6 (false) {}
19 void S::foo (E x) { this->s0 = x; }
35 void check (S &s, bool isfoo);
37 void test (bool isfoo)
39 S a = isfoo ? foo () : bar ();
43 extern "C" void abort ();
45 void check (S &s, bool isfoo)
47 if (! s.s1 || s.s2 || ! s.s3 || s.s4 || ! s.s5 || s.s6)
49 if (s.s0 != (isfoo ? E0 : E2))