view gcc/testsuite/g++.dg/torture/pr84190.C @ 131:84e7813d76e9

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

// { dg-do compile }
// For slim LTO there's no optimized dump
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
// { dg-additional-options "-fdump-tree-optimized" }

typedef double T;
static int equalfn (volatile T* x, volatile T* y);
T gx, gy;
int main ()
{
  T x = gx, y = gy;
  return equalfn (&x, &y);
}
static int equalfn (volatile T* x, volatile T* y)
{
  return (*x == *y);
}

// There should be exactly two volatile accesses (ignoring clobbers).
// { dg-final { scan-tree-dump-times " ={v} \[^\{\]" 2 "optimized" } }