+2017-12-20 Martin Liska <mliska@suse.cz>
+
+ PR middle-end/82404
+ * g++.dg/pr82404.C: New test.
+ * gcc.dg/pr82404.c: New test.
+
2017-12-20 Julia Koval <julia.koval@intel.com>
* gcc.target/i386/avx-1.c: Handle new intrinsics.
--- /dev/null
+// 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 } }
--- /dev/null
+// 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 } }