blob: 4ea070951dd1eb7f4bc153398b0d27bfcb83e543 [file]
;; 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 that --dx-strip-debug strips ILDB from DXContainer, but still keeps ILDN part
; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj --dx-strip-debug -o %t.cso
; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=STRIP --implicit-check-not ILDB
; STRIP: Parts:
; STRIP-DAG: - Name: ILDN
;; Check that --dx-strip-debug is ignored when provided along with --dx-embed-debug
; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj --dx-strip-debug --dx-embed-debug -o %t.cso
; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=STRIP-EMBED
; STRIP-EMBED: Parts:
; STRIP-EMBED-DAG: - Name: ILDB
; STRIP-EMBED-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
}