From: Martin Liska Date: Wed, 20 Dec 2017 08:50:56 +0000 (+0100) Subject: Add two test-cases for (PR middle-end/82404). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee050a6e44bf73f876cba57f85aeb39cca8ae952;p=gcc.git Add two test-cases for (PR middle-end/82404). 2017-12-20 Martin Liska PR middle-end/82404 * g++.dg/pr82404.C: New test. * gcc.dg/pr82404.c: New test. From-SVN: r255851 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aaa8c0551fe..50bd37b3166 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-12-20 Martin Liska + + PR middle-end/82404 + * g++.dg/pr82404.C: New test. + * gcc.dg/pr82404.c: New test. + 2017-12-20 Julia Koval * gcc.target/i386/avx-1.c: Handle new intrinsics. diff --git a/gcc/testsuite/g++.dg/pr82404.C b/gcc/testsuite/g++.dg/pr82404.C new file mode 100644 index 00000000000..9d860714865 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr82404.C @@ -0,0 +1,17 @@ +// PR middle-end/82404 + +// { dg-do compile } +// { dg-options "-O3 -Wall -fdump-tree-optimized -Wno-return-type" } + +enum eShape { eSquare, eCircle, eShpere, eTetraeder }; + +double test_switch_native(enum eShape shape, double r) { + switch(shape) { + case eSquare: return 2; + case eCircle: return 3; + case eShpere: return 4; + case eTetraeder: return 5; + } +} + +// { dg-final { scan-tree-dump-not "if " optimized } } diff --git a/gcc/testsuite/gcc.dg/pr82404.c b/gcc/testsuite/gcc.dg/pr82404.c new file mode 100644 index 00000000000..53565d310f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82404.c @@ -0,0 +1,17 @@ +// PR middle-end/82404 + +// { dg-do compile } +// { dg-options "-O3 -Wall -fdump-tree-optimized -Wno-return-type" } + +enum eShape { eSquare, eCircle, eShpere, eTetraeder }; + +double test_switch_native(enum eShape shape, double r) { + switch(shape) { + case eSquare: return 2; + case eCircle: return 3; + case eShpere: return 4; + case eTetraeder: return 5; + } +} + +// { dg-final { scan-tree-dump-times "if " 1 optimized } }