1; RUN: llc %s --filetype=asm -o - | FileCheck %s 2; RUN: opt %s -dxil-embed -S -o - | FileCheck %s 3; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC 4target triple = "dxil-unknown-shadermodel6.5-library" 5 6define i32 @add(i32 %a, i32 %b) { 7 %sum = add i32 %a, %b 8 ret i32 %sum 9} 10 11; CHECK: @dx.dxil = private constant [[BC_TYPE:\[[0-9]+ x i8\]]] c"BC\C0\DE{{[^"]+}}", section "DXIL", align 4 12; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @dx.dxil], section "llvm.metadata" 13 14; This is using regex matches on some sizes, offsets and fields. These are all 15; going to change as the DirectX backend continues to evolve and implement more 16; features. Rather than extending this test to cover those future features, this 17; test's matches are extremely fuzzy so that it won't break. 18 19; DXC: --- !dxcontainer 20; DXC-NEXT: Header: 21; DXC-NEXT: Hash: [ 0x0, 0x0, 0x0, 22; DXC: Version: 23; DXC-NEXT: Major: 1 24; DXC-NEXT: Minor: 0 25; DXC-NEXT: FileSize: [[#]] 26; DXC-NEXT: PartCount: [[#]] 27; DXC-NEXT: PartOffsets: [ {{[0-9, ]+}} ] 28; DXC-NEXT: Parts: 29 30; In verifying the DXIL part, this test captures the size of the part, and 31; derives the program header and dxil size fields from the part's size. 32 33; DXC: - Name: DXIL 34; DXC-NEXT: Size: [[#SIZE:]] 35; DXC-NEXT: Program: 36; DXC-NEXT: MajorVersion: 6 37; DXC-NEXT: MinorVersion: 5 38; DXC-NEXT: ShaderKind: 6 39; DXC-NEXT: Size: [[#div(SIZE,4) - 2]] 40; DXC-NEXT: DXILMajorVersion: [[#]] 41; DXC-NEXT: DXILMinorVersion: [[#]] 42; DXC-NEXT: DXILSize: [[#SIZE - 32]] 43; DXC-NEXT: DXIL: [ 0x42, 0x43, 0xC0, 0xDE, 44