brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 3f2dbec Raw
56 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json4// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps1.json5// RUN: mv %t/tu2.c %t/tu.c6// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps2.json7// RUN: diff -u %t/deps1.json %t/deps2.json8// RUN: FileCheck %s < %t/deps1.json9 10// CHECK: "-fmodule-file={{.*}}Indirect111// CHECK-NOT: "-fmodule-file={{.*}}Indirect12// CHECK: "-fmodule-file={{.*}}Indirect213// CHECK-NOT: "-fmodule-file={{.*}}Indirect14 15//--- cdb.json.template16[{17  "directory": "DIR",18  "command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",19  "file": "DIR/tu.c"20}]21 22//--- module.modulemap23module Indirect1 { header "Indirect1.h" }24module Indirect2 { header "Indirect2.h" }25module Mod {26  umbrella "Mod"27  module * { export * }28}29 30//--- Indirect1.h31void indirect1(void);32 33//--- Indirect2.h34void indirect2(void);35 36//--- Mod/SubMod1.h37#include "../Indirect1.h"38 39//--- Mod/SubMod2.h40#include "../Indirect2.h"41 42//--- tu.c43#include "Mod/SubMod1.h"44#include "Mod/SubMod2.h"45void tu1(void) {46  indirect1();47  indirect2();48}49 50//--- tu2.c51#include "Mod/SubMod2.h"52#include "Mod/SubMod1.h"53void tu1(void) {54  indirect1();55  indirect2();56}