view gcc/testsuite/g++.dg/opt/pr94618.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR rtl-optimization/94618
// { dg-do compile { target c++11 } }
// { dg-options "-O2 -fnon-call-exceptions -fcompare-debug" }

struct S
{
  int a, b, c;
  int foo () noexcept { return a; }
  int bar () noexcept { return b; }
  void baz (int);
  void qux () { if (c) for (int x = foo (); x != bar (); ) baz (x); }
};

struct T
{
  S s;
  void foo ();
};

void
T::foo ()
{
  s.qux ();
  s.qux ();
}