diff --git a/.gitattributes b/.gitattributes
index fd91b4d36e..7ffcdab275 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -8169,6 +8169,7 @@ tests/webtbs/tw1111.pp svneol=native#text/plain
 tests/webtbs/tw11139.pp svneol=native#text/plain
 tests/webtbs/tw11169.pp svneol=native#text/plain
 tests/webtbs/tw1117.pp svneol=native#text/plain
+tests/webtbs/tw11176.pp svneol=native#text/plain
 tests/webtbs/tw11216.pp svneol=native#text/plain
 tests/webtbs/tw1122.pp svneol=native#text/plain
 tests/webtbs/tw1123.pp svneol=native#text/plain
diff --git a/tests/webtbs/tw11176.pp b/tests/webtbs/tw11176.pp
new file mode 100644
index 0000000000..6ff6bcfcf9
--- /dev/null
+++ b/tests/webtbs/tw11176.pp
@@ -0,0 +1,17 @@
+type
+  Tx = (one,two,three);
+
+procedure error(number : longint);
+begin
+  writeln('error ', number);
+  halt(number);
+end;
+
+var
+  a : Tx;
+  err : word;
+
+begin
+  val('one', a, err);
+  if (err <> 0) or (a <> one) then error(1);
+end.
\ No newline at end of file