Add flags for DirectX in `llc`: * `--dx-embed-debug` to embed debug info into ILDB part of DXContainer * `--dx-pdb-path` to specify filename/path for PDB file output This patch does not add flags for clang Driver, they will be implemented later.
39 lines
1.7 KiB
LLVM
39 lines
1.7 KiB
LLVM
;; Check that --dx-embed-debug is enabled by default when debug info is present
|
|
; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -o %t.cso
|
|
; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=DEFAULT-EMBED
|
|
; DEFAULT-EMBED: Parts:
|
|
; DEFAULT-EMBED: - Name: ILDB
|
|
; DEFAULT-EMBED: - Name: ILDN
|
|
|
|
;; Check that debug info is not embedded if only the PDB ouput is specified
|
|
; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj --dx-pdb-path=%t.pdb -o %t.cso
|
|
; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=NO-EMBED
|
|
; NO-EMBED: Parts:
|
|
; NO-EMBED-NOT: - Name: ILDB
|
|
; NO-EMBED: - Name: ILDN
|
|
|
|
;; Check that debug info is both embedded and output to the PDB
|
|
;; if both options are specified
|
|
; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj --dx-embed-debug --dx-pdb-path=%t.pdb -o %t.cso
|
|
; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=EMBED
|
|
; EMBED: Parts:
|
|
; EMBED: - Name: ILDB
|
|
; EMBED: - Name: ILDN
|
|
; RUN: llvm-pdbutil pdb2yaml --dxcontainer %t.pdb | FileCheck %s --check-prefix=PDB
|
|
; Check that PDB file contains only debug-info relevant parts.
|
|
; PDB: Parts:
|
|
; PDB-DAG: - Name: ILDB
|
|
; PDB-DAG: - Name: ILDN
|
|
|
|
;; Check errors when trying to output debug info with no debug info present
|
|
; RUN: not llc %s --filetype=obj --dx-embed-debug -o %t.cso 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG
|
|
; ERROR-NODBG: Missing debug info for embedding into the container
|
|
; RUN: not llc %s --filetype=obj --dx-pdb-path=%t.pdb -o %t.cso 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG-PDB
|
|
; ERROR-NODBG-PDB: Missing debug info for writing to the PDB file
|
|
|
|
target triple = "dxil-unknown-shadermodel6.5-library"
|
|
|
|
define i32 @foo(i32 %a) {
|
|
ret i32 %a
|
|
}
|