summaryrefslogtreecommitdiff
path: root/source/compiler-core/slang-artifact.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-11 23:28:58 +0800
committerGitHub <noreply@github.com>2023-04-11 11:28:58 -0400
commitd6dd38f5210fedfd96ff088ef9b8a2424c79c4f0 (patch)
tree31d79abe8e205ef5ae7605b2290aa357e80f324b /source/compiler-core/slang-artifact.h
parent20ea33f3321738e7c1b4cad7bdcaedcdb54dd0f0 (diff)
Implement FileCheck tests for several test commands (#2747)
* Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests * Implement FileCheck tests for several test commands - SIMPLE, SIMPLE_EX - SIMPLE_LINE - REFLECTION, CPU_REFLECTION - CROSS_COMPILE It does not currently support the render tests or the COMPARE_COMPUTE commands It is invoked by adding `(filecheck=MY_FILECHECK_PREFIX)` to the test command, for example TEST:CROSS_COMPILE(filecheck=SPIRV): -target spirv-assembly * Move LLVM FileCheck interface to slang-llvm * Neaten slang-test tests * Refine handling of expected output in slang-test * Add example FileCheck buffer test * Add cuda-kernel-export tests Which were waiting on FileCheck * Bump vs project files * Make createLLVMFileCheck_V1 return a void* rather than specifically an IFileCheck * Remove use of CharSlice from filecheck interface * Bump slang-llvm version --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'source/compiler-core/slang-artifact.h')
-rw-r--r--source/compiler-core/slang-artifact.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/compiler-core/slang-artifact.h b/source/compiler-core/slang-artifact.h
index 80db717d0..6072cdf76 100644
--- a/source/compiler-core/slang-artifact.h
+++ b/source/compiler-core/slang-artifact.h
@@ -5,6 +5,8 @@
#include "../core/slang-basic.h"
#include "../../slang-com-helper.h"
+#include <type_traits>
+
namespace Slang
{
@@ -47,7 +49,9 @@ struct CharSlice : public Slice<char>
explicit CharSlice(const char* in) :Super(in, ::strlen(in)) {}
CharSlice(const char* in, Count inCount) :Super(in, inCount) {}
CharSlice() :Super(nullptr, 0) {}
+ explicit CharSlice(const String& s) :CharSlice(s.begin(), s.getLength()){};
};
+static_assert(std::is_trivially_copyable_v<CharSlice>);
struct TerminatedCharSlice : public CharSlice
{
@@ -64,6 +68,7 @@ struct TerminatedCharSlice : public CharSlice
TerminatedCharSlice(const char* in, Count inCount) :Super(in, inCount) { SLANG_ASSERT(in[inCount] == 0); }
TerminatedCharSlice() :Super("", 0) {}
};
+static_assert(std::is_trivially_copyable_v<TerminatedCharSlice>);
/* As a rule of thumb, if we can define some aspect in a hierarchy then we should do so at the highest level.
If some aspect can apply to multiple items identically we move that to a separate enum.