================
@@ -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( "
----------------
inbelic wrote:

The tests for "expected one of the following kinds: .." address this case

https://github.com/llvm/llvm-project/pull/123985
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to