[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)
Sarah Spall via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Feb 11 09:27:47 PST 2025
================
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify
+
+// This file mirrors the diagnostics testing in ParseHLSLRootSignatureTest.cpp
+// to verify that the correct diagnostics strings are output
+
+// Lexer related tests
+
+#define InvalidToken \
+ "DescriptorTable( " \
+ " invalid " \
+ ")"
+
+[RootSignature(InvalidToken)] // expected-error {{unable to lex a valid Root Signature token}}
+void bad_root_signature_1() {}
+
+#define InvalidEmptyNumber \
+ "DescriptorTable( " \
+ " CBV(t32, space = +) " \
+ ")"
+
+[RootSignature(InvalidEmptyNumber)] // expected-error {{expected number literal is not a supported number literal of unsigned integer or integer}}
+void bad_root_signature_2() {}
+
+#define InvalidOverflowNumber \
+ "DescriptorTable( " \
+ " CBV(t32, space = 98273498327498273487) " \
+ ")"
+
+[RootSignature(InvalidOverflowNumber)] // expected-error {{provided unsigned integer literal '98273498327498273487' that overflows the maximum of 32 bits}}
+void bad_root_signature_3() {}
+
+#define InvalidEOS \
+ "DescriptorTable( "
----------------
spall wrote:
Is it worth adding a test with too many parens?
https://github.com/llvm/llvm-project/pull/123985
More information about the llvm-branch-commits
mailing list