Skip to content

Commit ae3d03f

Browse files
author
joaosaffran
committed
adding llvm unreachable and testing test
1 parent 3b135c6 commit ae3d03f

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static bool parseRootSignatureElement(LLVMContext *Ctx,
6969
"Invalid Root Element: " + ElementText->getString());
7070
}
7171

72-
return true;
72+
llvm_unreachable("Root signature element kind not expected.");
7373
}
7474

7575
static bool parse(LLVMContext *Ctx, ModuleRootSignature *MRS, NamedMDNode *Root,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; RUN: not llc %s --filetype=obj -o -
2+
; expected-error@-1: More than one entry function defined
3+
4+
target triple = "dxil-unknown-shadermodel6.0-compute"
5+
6+
7+
define void @main() #0 {
8+
entry:
9+
ret void
10+
}
11+
12+
define void @anotherMain() #1 {
13+
entry:
14+
ret void
15+
}
16+
17+
attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
18+
attributes #1 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
19+
20+
!dx.rootsignatures = !{!2, !5} ; list of function/root signature pairs
21+
!2 = !{ ptr @main, !3 } ; function, root signature
22+
!3 = !{ !4 } ; list of root signature elements
23+
!4 = !{ !"RootFlags", i32 1 } ; 1 = allow_input_assembler_input_layout
24+
!5 = !{ ptr @anotherMain, !6 } ; function, root signature
25+
!6 = !{ !7 } ; list of root signature elements
26+
!7 = !{ !"RootFlags", i32 2 } ; 1 = allow_input_assembler_input_layout

0 commit comments

Comments
 (0)