Debian Codegraph @

gcc/testsuite/g++.dg/torture/pr84190.C

raw
1 // { dg-do compile }
2 // For slim LTO there's no optimized dump
3 // { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
4 // { dg-additional-options "-fdump-tree-optimized" }
5
6 typedef double T;
7 static int equalfn (volatile T* x, volatile T* y);
8 T gx, gy;
9 int main ()
10 {
11 T x = gx, y = gy;
12 return equalfn (&x, &y);
13 }
14 static int equalfn (volatile T* x, volatile T* y)
15 {
16 return (*x == *y);
17 }
18
19 // There should be exactly two volatile accesses (ignoring clobbers).
20 // { dg-final { scan-tree-dump-times " ={v} \[^\{\]" 2 "optimized" } }