summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bindings/array-of-struct-of-resource.hlsl2
-rw-r--r--tests/bindings/binding0.hlsl2
-rw-r--r--tests/bindings/binding1.hlsl2
-rw-r--r--tests/bindings/explicit-binding.hlsl2
-rw-r--r--tests/bindings/multi-file.hlsl2
-rw-r--r--tests/bindings/parameter-blocks.slang2
-rw-r--r--tests/bindings/resources-in-cbuffer.hlsl2
-rw-r--r--tests/bindings/targets-and-uavs-structure.hlsl2
-rw-r--r--tests/bindings/targets-and-uavs.hlsl2
-rw-r--r--tests/bugs/gh-103.slang2
-rw-r--r--tests/bugs/gh-333.slang2
-rw-r--r--tests/bugs/gh-666.slang2
-rw-r--r--tests/bugs/split-nested-types.hlsl2
-rw-r--r--tests/hlsl/simple/allow-uav-conditional.hlsl4
-rw-r--r--tests/hlsl/simple/compute-numthreads.hlsl2
-rw-r--r--tests/hlsl/simple/implicit_conversion.hlsl2
-rw-r--r--tests/hlsl/simple/literal-typing.hlsl2
-rw-r--r--tests/hlsl/simple/rw-texture.hlsl2
-rw-r--r--tests/language-feature/no-hlsl-binding.slang21
-rw-r--r--tests/language-feature/no-mangle.slang27
-rw-r--r--tests/rewriter/varying-struct.vert2
21 files changed, 68 insertions, 20 deletions
diff --git a/tests/bindings/array-of-struct-of-resource.hlsl b/tests/bindings/array-of-struct-of-resource.hlsl
index 240ffed73..393ff4ec2 100644
--- a/tests/bindings/array-of-struct-of-resource.hlsl
+++ b/tests/bindings/array-of-struct-of-resource.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_1 -entry main
+//TEST:COMPARE_HLSL: -profile ps_5_1 -entry main
// Let's first confirm that Slang can reproduce what the
// HLSL compiler would already do in the simple case (when
diff --git a/tests/bindings/binding0.hlsl b/tests/bindings/binding0.hlsl
index 2ae40ead3..5e74b44cd 100644
--- a/tests/bindings/binding0.hlsl
+++ b/tests/bindings/binding0.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_4_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_4_0 -entry main
// Let's first confirm that Slang can reproduce what the
// HLSL compiler would already do in the simple case (when
diff --git a/tests/bindings/binding1.hlsl b/tests/bindings/binding1.hlsl
index 47ab22bb9..957d9614c 100644
--- a/tests/bindings/binding1.hlsl
+++ b/tests/bindings/binding1.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_4_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_4_0 -entry main
// We want to make sure that the registers Slang generates
// are used, even if there are "dead" parameter earlier in the program.
diff --git a/tests/bindings/explicit-binding.hlsl b/tests/bindings/explicit-binding.hlsl
index 420eafec1..d58e232e9 100644
--- a/tests/bindings/explicit-binding.hlsl
+++ b/tests/bindings/explicit-binding.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_4_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_4_0 -entry main
// We need to allow the user to add explicit bindings to their parameters,
// and we can't go and auto-assign anything to use the same locations.
diff --git a/tests/bindings/multi-file.hlsl b/tests/bindings/multi-file.hlsl
index 1bf025d9c..bc05d6338 100644
--- a/tests/bindings/multi-file.hlsl
+++ b/tests/bindings/multi-file.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile sm_4_0 -entry main1 -stage vertex Tests/bindings/multi-file-extra.hlsl -entry main -stage fragment
+//TEST:COMPARE_HLSL: -profile sm_4_0 -entry main1 -stage vertex Tests/bindings/multi-file-extra.hlsl -entry main -stage fragment
// Here we are going to test that we can correctly generating bindings when we
// are presented with a program spanning multiple input files (and multiple entry points)
diff --git a/tests/bindings/parameter-blocks.slang b/tests/bindings/parameter-blocks.slang
index 6941ce77c..2e5bc908e 100644
--- a/tests/bindings/parameter-blocks.slang
+++ b/tests/bindings/parameter-blocks.slang
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_1 -entry main -parameter-blocks-use-register-spaces
+//TEST:COMPARE_HLSL: -profile ps_5_1 -entry main -parameter-blocks-use-register-spaces
// Confirm that Slang `ParameterBlock<T>` generates
// parameter bindings like we expect.
diff --git a/tests/bindings/resources-in-cbuffer.hlsl b/tests/bindings/resources-in-cbuffer.hlsl
index 71eaf40aa..e52c20e06 100644
--- a/tests/bindings/resources-in-cbuffer.hlsl
+++ b/tests/bindings/resources-in-cbuffer.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_4_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_4_0 -entry main
// Confirm that resources inside constant buffers get correct locations,
// including the case where there are *multiple* constant buffers
diff --git a/tests/bindings/targets-and-uavs-structure.hlsl b/tests/bindings/targets-and-uavs-structure.hlsl
index dd860369d..7f5ca2b80 100644
--- a/tests/bindings/targets-and-uavs-structure.hlsl
+++ b/tests/bindings/targets-and-uavs-structure.hlsl
@@ -1,4 +1,4 @@
-//TEST(smoke):COMPARE_HLSL:-no-mangle -profile ps_5_0 -entry main
+//TEST(smoke):COMPARE_HLSL: -profile ps_5_0 -entry main
// Handle the case where the fragment shader output is
// defined a structure, and the semantics are on the sub-fields
diff --git a/tests/bindings/targets-and-uavs.hlsl b/tests/bindings/targets-and-uavs.hlsl
index ac64c8f5f..c56e1151d 100644
--- a/tests/bindings/targets-and-uavs.hlsl
+++ b/tests/bindings/targets-and-uavs.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_5_0 -entry main
// Render target outputs (`SV_Target`) and UAVs are treated
// as sharing the same binding slots in HLSL, so we need to
diff --git a/tests/bugs/gh-103.slang b/tests/bugs/gh-103.slang
index 4bad20b20..a0992463d 100644
--- a/tests/bugs/gh-103.slang
+++ b/tests/bugs/gh-103.slang
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_4_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_4_0 -entry main
// Ensure that matrix-times-scalar works
diff --git a/tests/bugs/gh-333.slang b/tests/bugs/gh-333.slang
index a1e3ea20d..b3ecf9204 100644
--- a/tests/bugs/gh-333.slang
+++ b/tests/bugs/gh-333.slang
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_5_0 -entry main
// Ensure declaration order in output is correct
diff --git a/tests/bugs/gh-666.slang b/tests/bugs/gh-666.slang
index fa46d1de7..ff891d794 100644
--- a/tests/bugs/gh-666.slang
+++ b/tests/bugs/gh-666.slang
@@ -1,6 +1,6 @@
// gh-666.slang
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_5_0 -entry main
static const uint foo = 1;
static const uint bar = foo;
diff --git a/tests/bugs/split-nested-types.hlsl b/tests/bugs/split-nested-types.hlsl
index 2bfea49c2..723e6d414 100644
--- a/tests/bugs/split-nested-types.hlsl
+++ b/tests/bugs/split-nested-types.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0
+//TEST:COMPARE_HLSL: -profile ps_5_0
#ifdef __SLANG__
diff --git a/tests/hlsl/simple/allow-uav-conditional.hlsl b/tests/hlsl/simple/allow-uav-conditional.hlsl
index b9780e97d..c75e42280 100644
--- a/tests/hlsl/simple/allow-uav-conditional.hlsl
+++ b/tests/hlsl/simple/allow-uav-conditional.hlsl
@@ -1,5 +1,5 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0
-//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0 -verify-debug-serial-ir
+//TEST:COMPARE_HLSL: -profile cs_5_0
+//TEST:COMPARE_HLSL: -profile cs_5_0 -verify-debug-serial-ir
// Check output for `[allow_uav_conditional]`
diff --git a/tests/hlsl/simple/compute-numthreads.hlsl b/tests/hlsl/simple/compute-numthreads.hlsl
index 34d9bfd4f..3c0d8e57b 100644
--- a/tests/hlsl/simple/compute-numthreads.hlsl
+++ b/tests/hlsl/simple/compute-numthreads.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile cs_5_0 -entry main
// Confirm that we properly pass along the `numthreads` attribute on an entry point.
diff --git a/tests/hlsl/simple/implicit_conversion.hlsl b/tests/hlsl/simple/implicit_conversion.hlsl
index 2a3700e62..36738ea45 100644
--- a/tests/hlsl/simple/implicit_conversion.hlsl
+++ b/tests/hlsl/simple/implicit_conversion.hlsl
@@ -1,4 +1,4 @@
-//TEST_DISABLED:COMPARE_HLSL:-no-mangle -profile cs_5_0 -entry main
+//TEST_DISABLED:COMPARE_HLSL: -profile cs_5_0 -entry main
// Test various cases of implicit type conversion and preference
// for overload resolution.
diff --git a/tests/hlsl/simple/literal-typing.hlsl b/tests/hlsl/simple/literal-typing.hlsl
index 6c003eb21..51e58201b 100644
--- a/tests/hlsl/simple/literal-typing.hlsl
+++ b/tests/hlsl/simple/literal-typing.hlsl
@@ -1,4 +1,4 @@
-//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile cs_5_0 -entry main
// Confirm that we get the typing of literal suffixes correct
diff --git a/tests/hlsl/simple/rw-texture.hlsl b/tests/hlsl/simple/rw-texture.hlsl
index 114d9e126..af2f5a183 100644
--- a/tests/hlsl/simple/rw-texture.hlsl
+++ b/tests/hlsl/simple/rw-texture.hlsl
@@ -1,6 +1,6 @@
// rw-texture.hlsl
-//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0 -entry main
+//TEST:COMPARE_HLSL: -profile ps_5_0 -entry main
// Ensure that we implement the `Load` operations on
// `RWTexture*` types with the correct signature.
diff --git a/tests/language-feature/no-hlsl-binding.slang b/tests/language-feature/no-hlsl-binding.slang
new file mode 100644
index 000000000..57f0449f9
--- /dev/null
+++ b/tests/language-feature/no-hlsl-binding.slang
@@ -0,0 +1,21 @@
+//TEST:SIMPLE(filecheck=CHECK):-target hlsl -entry main -profile cs_6_0 -no-mangle -no-hlsl-binding
+
+// Test that -no-hlsl-binding option disables automatically assigned bindings in the hlsl output.
+
+// CHECK-DAG: cbuffer {{.*}} : register(b3)
+cbuffer MyCB : register(b3)
+{
+ int member;
+}
+
+// CHECK-DAG: RWStructuredBuffer<float > outputBuffer : register(u2);
+RWStructuredBuffer<float> outputBuffer : register(u2);
+
+// CHECK-DAG: RWStructuredBuffer<int > inputBuffer;
+RWStructuredBuffer<int> inputBuffer;
+
+[numthreads(1,1,1)]
+void main()
+{
+ outputBuffer[0] = inputBuffer[0] + member;
+}
diff --git a/tests/language-feature/no-mangle.slang b/tests/language-feature/no-mangle.slang
new file mode 100644
index 000000000..11462ef26
--- /dev/null
+++ b/tests/language-feature/no-mangle.slang
@@ -0,0 +1,27 @@
+//TEST:SIMPLE(filecheck=CHECK):-target hlsl -entry main -profile cs_6_0 -no-mangle
+
+// Test that -no-mangle option disables name mangling on global parameters and struct fields.
+
+cbuffer BufferName
+{
+ int cbufferParam;
+}
+
+struct MyStruct
+{
+ int v;
+}
+
+RWStructuredBuffer<MyStruct> outputBuffer;
+
+// CHECK-DAG: SLANG_ParameterGroup_BufferName{{.*}} BufferName;
+
+// CHECK-DAG: RWStructuredBuffer<{{.*}}> outputBuffer :
+
+[numthreads(1,1,1)]
+void main()
+{
+ // CHECK-DAG: = {{.*}}cbufferParam;
+
+ outputBuffer[0].v = cbufferParam;
+} \ No newline at end of file
diff --git a/tests/rewriter/varying-struct.vert b/tests/rewriter/varying-struct.vert
index 042125b15..aae26a6ed 100644
--- a/tests/rewriter/varying-struct.vert
+++ b/tests/rewriter/varying-struct.vert
@@ -1,5 +1,5 @@
#version 450 core
-//TEST_DISABLED:COMPARE_GLSL:-no-mangle
+//TEST_DISABLED:COMPARE_GLSL:
#if defined(__SLANG__)