1 ; RUN: opt %s -dxil-embed -S -o - | FileCheck %s
2 ; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC
3 target triple = "dxil-unknown-shadermodel6.5-library"
5 ; Make sure triple is restored after updated to dxil.
6 ; CHECK:target triple = "dxil-unknown-shadermodel6.5-library"
8 define i32 @add(i32 %a, i32 %b) {
13 ; CHECK: @dx.dxil = private constant [[BC_TYPE:\[[0-9]+ x i8\]]] c"BC\C0\DE{{[^"]+}}", section "DXIL", align 4
15 ; The dxil global should be the first here because we generate it before the
16 ; other globals. If it isn't the first here, that's probably a bug.
17 ; CHECK: @llvm.compiler.used = appending global {{\[[0-9]+ x ptr\]}} [ptr @dx.dxil
19 ; This is using regex matches on some sizes, offsets and fields. These are all
20 ; going to change as the DirectX backend continues to evolve and implement more
21 ; features. Rather than extending this test to cover those future features, this
22 ; test's matches are extremely fuzzy so that it won't break.
24 ; DXC: --- !dxcontainer
26 ; DXC-NEXT: Hash: [ 0x0, 0x0, 0x0,
30 ; DXC-NEXT: FileSize: [[#]]
31 ; DXC-NEXT: PartCount: [[#]]
32 ; DXC-NEXT: PartOffsets: [ {{[0-9, ]+}} ]
35 ; In verifying the DXIL part, this test captures the size of the part, and
36 ; derives the program header and dxil size fields from the part's size.
39 ; DXC-NEXT: Size: [[#SIZE:]]
41 ; DXC-NEXT: MajorVersion: 6
42 ; DXC-NEXT: MinorVersion: 5
43 ; DXC-NEXT: ShaderKind: 6
44 ; DXC-NEXT: Size: [[#div(SIZE,4)]]
45 ; DXC-NEXT: DXILMajorVersion: 1
46 ; DXC-NEXT: DXILMinorVersion: 5
47 ; DXC-NEXT: DXILSize: [[#SIZE - 24]]
48 ; DXC-NEXT: DXIL: [ 0x42, 0x43, 0xC0, 0xDE,