diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr58006.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr58006.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr58006.C b/gcc/testsuite/g++.dg/opt/pr58006.C new file mode 100644 index 00000000000..fd3b7bebd8a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr58006.C @@ -0,0 +1,22 @@ +// PR tree-optimization/58006 +// { dg-do compile } +// { dg-require-effective-target pthread } +// { dg-options "-Ofast -ftree-parallelize-loops=2" } + +extern "C" float sqrtf (float); + +struct S +{ + float i, j; + float foo () const { return sqrtf (i * i + j * j); } + S () : i (1), j (1) {} +}; + +void +bar (int a, int b) +{ + int i; + float f; + for (i = a; i < b; i++) + f = S ().foo (); +} |