summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-08 16:54:33 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-08 18:22:26 -0700
commitc77c0390d8da6c1769e0a9c5b2f862b3598d9b8f (patch)
tree371eb704e5234a819572f390ac940fa673650040
parent836a9985ac8540c2c9b27fd438ce757dc6884b9b (diff)
Revise the (only) rewriter-error test case
This was testing that we let the downstream compiler report a parse error, but that is no longer a goal (because we need to rewrite function bodies to deal with type validation). I've switched it to a type error in the function body, and confirmed that we do let fxc report the problem.
-rw-r--r--tests/rewriter/error0.hlsl16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/rewriter/error0.hlsl b/tests/rewriter/error0.hlsl
index 10957e9e5..e42dec23e 100644
--- a/tests/rewriter/error0.hlsl
+++ b/tests/rewriter/error0.hlsl
@@ -4,14 +4,24 @@
// the input code, we allow the downstream compiler
// to detect and report the error, not us...
-// This file presents a simple case, where we forgot a semicolon.
+// A key goal here is that errors get reported at
+// the right source location, ideally including
+// all of file, line, and column info.
+
+// This file used to have a parse error (missing semicolon),
+// but at this point we need to parse function bodies, even
+// if we don't check them, so we can't avoid reporting that one.
+//
+// I'm switching it to a type error instead:
+
+struct S { int x; };
float4 main() : SV_Target
{
float a = 1.0;
- // no semicolon at the end of this line!
- float b = 2.0
+ // Invalid assignment:
+ S s = a;
float c = a + b;