Change remaining compile-time folding errors to warnings

The GLES working group has decided to amend the spec so that
implementations are not allowed to generate compile errors on
undefined values detected at compile time. Change the remaining
folding errors to warnings to follow the newly clarified rules.

The end2end_tests covering this are removed, since they're
redundant with the more efficient unit test.

BUG=angleproject:1703
TEST=angle_unittests

Change-Id: I97d2fd532dbe5733581bdc4aa40a5d7d3734fc0d
Reviewed-on: https://chromium-review.googlesource.com/427799
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ConstantUnion.cpp b/src/compiler/translator/ConstantUnion.cpp
index cab1031..464c30c 100644
--- a/src/compiler/translator/ConstantUnion.cpp
+++ b/src/compiler/translator/ConstantUnion.cpp
@@ -58,6 +58,12 @@
     return result;
 }
 
+bool IsValidShiftOffset(const TConstantUnion &rhs)
+{
+    return (rhs.getType() == EbtInt && (rhs.getIConst() >= 0 && rhs.getIConst() <= 31)) ||
+           (rhs.getType() == EbtUInt && rhs.getUConst() <= 31u);
+}
+
 }  // anonymous namespace
 
 TConstantUnion::TConstantUnion()
@@ -377,10 +383,9 @@
     TConstantUnion returnValue;
     ASSERT(lhs.type == EbtInt || lhs.type == EbtUInt);
     ASSERT(rhs.type == EbtInt || rhs.type == EbtUInt);
-    if ((rhs.type == EbtInt && (rhs.iConst < 0 || rhs.iConst > 31)) ||
-        (rhs.type == EbtUInt && rhs.uConst > 31u))
+    if (!IsValidShiftOffset(rhs))
     {
-        diag->error(line, "Undefined shift (operand out of range)", ">>");
+        diag->warning(line, "Undefined shift (operand out of range)", ">>");
         switch (lhs.type)
         {
             case EbtInt:
@@ -484,10 +489,9 @@
     TConstantUnion returnValue;
     ASSERT(lhs.type == EbtInt || lhs.type == EbtUInt);
     ASSERT(rhs.type == EbtInt || rhs.type == EbtUInt);
-    if ((rhs.type == EbtInt && (rhs.iConst < 0 || rhs.iConst > 31)) ||
-        (rhs.type == EbtUInt && rhs.uConst > 31u))
+    if (!IsValidShiftOffset(rhs))
     {
-        diag->error(line, "Undefined shift (operand out of range)", "<<");
+        diag->warning(line, "Undefined shift (operand out of range)", "<<");
         switch (lhs.type)
         {
             case EbtInt: