File: debug-info-objname.cpp

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (41 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// REQUIRES: x86-registered-target
// RUN: rm -rf %t && mkdir %t && cd %t
// RUN: cp %s debug-info-objname.cpp

/// No output file provided, input file is relative, we emit an absolute path (MSVC behavior).
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc debug-info-objname.cpp
// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE

/// No output file provided, input file is absolute, we emit an absolute path (MSVC behavior).
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -- %t/debug-info-objname.cpp
// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE

/// The output file is provided as an absolute path, we emit an absolute path.
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc /Fo%t/debug-info-objname.obj -- %t/debug-info-objname.cpp
// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE

/// The output file is provided as relative path, -working-dir is provided, we emit an absolute path.
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -working-dir=%t debug-info-objname.cpp
// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE

/// The input file name is relative and we specify -fdebug-compilation-dir, we emit a relative path.
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. debug-info-objname.cpp
// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=RELATIVE

/// Ensure /FA emits an .asm file which contains the path to the final .obj, not the .asm
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. /FA debug-info-objname.cpp
// RUN: FileCheck --input-file=debug-info-objname.asm --check-prefix=ASM %s

/// Same thing for -save-temps
// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. /clang:-save-temps debug-info-objname.cpp
// RUN: FileCheck --input-file=debug-info-objname.asm --check-prefix=ASM %s

int main() {
  return 1;
}

// ABSOLUTE: S_OBJNAME [size = [[#]]] sig=0, `{{.+}}debug-info-objname.obj`
// RELATIVE: S_OBJNAME [size = [[#]]] sig=0, `debug-info-objname.obj`
// ASM: Record kind: S_OBJNAME
// ASM-NEXT: .long   0
// ASM-NEXT: .asciz  "debug-info-objname.obj"