brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 73d3bb4 Raw
42 lines · cpp
1// REQUIRES: x86-registered-target2// RUN: rm -rf %t && mkdir %t && cd %t3// RUN: cp %s debug-info-objname.cpp4 5/// No output file provided, input file is relative, we emit an absolute path (MSVC behavior).6// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc debug-info-objname.cpp7// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE8 9/// No output file provided, input file is absolute, we emit an absolute path (MSVC behavior).10// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -- %t/debug-info-objname.cpp11// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE12 13/// The output file is provided as an absolute path, we emit an absolute path.14// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc /Fo%t/debug-info-objname.obj -- %t/debug-info-objname.cpp15// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE16 17/// The output file is provided as relative path, -working-dir is provided, we emit an absolute path.18// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -working-dir=%t debug-info-objname.cpp19// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=ABSOLUTE20 21/// The input file name is relative and we specify -fdebug-compilation-dir, we emit a relative path.22// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. debug-info-objname.cpp23// RUN: llvm-pdbutil dump -all debug-info-objname.obj | FileCheck %s --check-prefix=RELATIVE24 25/// Ensure /FA emits an .asm file which contains the path to the final .obj, not the .asm26// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. /FA debug-info-objname.cpp27// RUN: FileCheck --input-file=debug-info-objname.asm --check-prefix=ASM %s28 29/// Same thing for -save-temps30// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -nostdinc -fdebug-compilation-dir=. /clang:-save-temps debug-info-objname.cpp31// RUN: FileCheck --input-file=debug-info-objname.asm --check-prefix=ASM %s32 33int main() {34  return 1;35}36 37// ABSOLUTE: S_OBJNAME [size = [[#]]] sig=0, `{{.+}}debug-info-objname.obj`38// RELATIVE: S_OBJNAME [size = [[#]]] sig=0, `debug-info-objname.obj`39// ASM: Record kind: S_OBJNAME40// ASM-NEXT: .long   041// ASM-NEXT: .asciz  "debug-info-objname.obj"42