summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/gh-449.slang7
-rw-r--r--tests/bugs/gh-449.slang.expected4
-rw-r--r--tests/bugs/gh-841.slang14
3 files changed, 23 insertions, 2 deletions
diff --git a/tests/bugs/gh-449.slang b/tests/bugs/gh-449.slang
index 9ce678b53..1b7a9f07d 100644
--- a/tests/bugs/gh-449.slang
+++ b/tests/bugs/gh-449.slang
@@ -1,5 +1,6 @@
// gh-449.slang
//TEST:SIMPLE:
+//TEST:SIMPLE(filecheck=CHECK):
// Issue when dealing with binary operations that
// mix scalars with vectors that have a different
@@ -16,10 +17,16 @@ void main()
float2 a = float2(1, 2);
uint b = 3;
foo(a + b);
+ // CHECK: tests/bugs/gh-449.slang([[#@LINE-1]]): error 30019: expected an expression of type 'S', got 'vector<float,2>'
+ // CHECK-NEXT: foo(a + b);
+ // CHECK-NEXT: ^
// This used to get confused, with the `f` getting converted
// to a `uint` before the addition.
uint2 u = uint2(1, 2);
float f = 3.0;
foo(u + f);
+ // CHECK: tests/bugs/gh-449.slang([[#@LINE-1]]): error 30019: expected an expression of type 'S', got 'vector<float,2>'
+ // CHECK-NEXT: foo(u + f);
+ // CHECK-NEXT: ^
}
diff --git a/tests/bugs/gh-449.slang.expected b/tests/bugs/gh-449.slang.expected
index 8ca87a406..4d01e7fe3 100644
--- a/tests/bugs/gh-449.slang.expected
+++ b/tests/bugs/gh-449.slang.expected
@@ -1,9 +1,9 @@
result code = -1
standard error = {
-tests/bugs/gh-449.slang(18): error 30019: expected an expression of type 'S', got 'vector<float,2>'
+tests/bugs/gh-449.slang(19): error 30019: expected an expression of type 'S', got 'vector<float,2>'
foo(a + b);
^
-tests/bugs/gh-449.slang(24): error 30019: expected an expression of type 'S', got 'vector<float,2>'
+tests/bugs/gh-449.slang(28): error 30019: expected an expression of type 'S', got 'vector<float,2>'
foo(u + f);
^
}
diff --git a/tests/bugs/gh-841.slang b/tests/bugs/gh-841.slang
index 44d8348e5..8dc687e77 100644
--- a/tests/bugs/gh-841.slang
+++ b/tests/bugs/gh-841.slang
@@ -1,12 +1,26 @@
// gh-841.slang
//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:CROSS_COMPILE(filecheck=SPV): -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:CROSS_COMPILE(filecheck=GLSL): -profile ps_5_0 -entry main -target glsl
// GitHub issue #841: failing to emit `flat` modifier in output GLSL when required
struct RasterVertex
{
+ // location 0
float4 c : COLOR;
+
+ // Make sure that the input value in location 1 is decorated as Flat
+ // SPV-DAG: [[#VAL:]]{{.*}}:{{.*}} Variable Input
+ // SPV-DAG: Decorate [[#VAL]]{{.*}} Location 1
+ // SPV-DAG: Decorate [[#VAL]]{{.*}} Flat
+ //
+ // Likewise for GLSL
+ // GLSL: flat layout(location = 1)
+ // GLSL-NEXT: in uint {{[[:alnum:]_]+}};
+ //
+ // location 1
uint u : FLAGS;
};