37 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json4// RUN: clang-scan-deps -compilation-database %t/cdb.json -format \5// RUN: experimental-full -optimize-args=all > %t/result.json6// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s7 8// RUN: %deps-to-rsp %t/result.json --module-name=mod > %t/mod.rsp9// RUN: %clang @%t/mod.rsp -o %t/mod.pcm10// RUN: llvm-dwarfdump --debug-info %t/mod.pcm | FileCheck %s --check-prefix=DWARF11// DWARF: DW_TAG_compile_unit12// DWARF-NOT: DW_AT_comp_dir13 14//--- cdb.json.in15[{16 "directory": "DIR",17 "command": "clang -c -g -gmodules DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache -IDIR/include/ -fdebug-compilation-dir=DIR -o DIR/tu.o",18 "file": "DIR/tu.c"19}]20 21//--- include/module.modulemap22module mod {23 header "mod.h"24}25 26//--- include/mod.h27 28//--- tu.c29#include "mod.h"30 31// Check the -fdebug-compilation-dir used for the module is the root32// directory when current working directory optimization is in effect.33// CHECK: "modules": [34// CHECK: "command-line": [35// CHECK-NOT: -fdebug-compilation-dir36// CHECK: "translation-units": [37