view gcc/testsuite/g++.dg/tree-ssa/lifetime-dse1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

// PR c++/61982
// { dg-additional-options "-O2 -fdump-tree-optimized -fdelete-null-pointer-checks" }
// { dg-final { scan-tree-dump-not "= 0" "optimized" } }

struct X { 
  int i; 
  void clear() { i = 0; }
}; 

void f(X* x) { 
  x->clear(); 
  x->~X(); 
} 

void g(X* x) {
  x->clear();
  delete x;
}