summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2019-07-03 13:58:35 -0700
committerGitHub <noreply@github.com>2019-07-03 13:58:35 -0700
commit691ebae763e29327249735d67fbb231c75b17840 (patch)
tree56a96dc8abbadccd21e1ec129ac79a861f8dc7bc /tests
parent714b0881974965e8fcfbc57b452ef648290d14a1 (diff)
Fix declaration of scalar sincos() function. (#996)
The function was accidentally defined with a generic `int` parameter copy-pasted from the vector definition, but that made the scalar version impossible to call with inferred generic arguments, because there wasn't a way to infer `N` when it isn't used in the parameter list. Includes a simple test case to confirm that the front-end no longer chokes on calls to scalar `sincos()`.
Diffstat (limited to 'tests')
-rw-r--r--tests/front-end/sincos.slang19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/front-end/sincos.slang b/tests/front-end/sincos.slang
new file mode 100644
index 000000000..b7e7beaad
--- /dev/null
+++ b/tests/front-end/sincos.slang
@@ -0,0 +1,19 @@
+// sincos.slang
+//TEST:SIMPLE:
+
+// Just confirming that calls to the `sincos()` built
+// in work in the front-end.
+
+float test( float4x4 m, float4 v, float a )
+{
+ float4x4 mc, ms;
+ sincos(m, mc, ms);
+
+ float4 vc, vs;
+ sincos(v, vc, vs);
+
+ float c, s;
+ sincos(a, c, s);
+
+ return c + s + vc[0] + vs[0] + mc[0][0] + ms[0][0];
+}