view gcc/testsuite/g++.dg/opt/life1.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// This testcase did not set up the pic register on IA-32 due
// to bug in calculate_global_regs_live EH edge handling.
// { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } }
// { dg-require-effective-target fpic }
// { dg-options "-O2 -fPIC" }

struct A { };

void foo (A (*fn)())
{
  try {
    A a = fn ();
  } catch (...) {
  }
}

// { dg-final { scan-assembler "GLOBAL_OFFSET_TABLE" } }