brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 3c8de70 Raw
60 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json4 5// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -mode preprocess-dependency-directives > %t/result.txt6 7// RUN: FileCheck %s -input-file %t/result.txt8 9// Verify that there's a single version of module A.10 11// CHECK:        "modules": [12// CHECK-NEXT:     {13// CHECK:            "command-line": [14// CHECK-NOT:          "-fvisibility="15// CHECK-NOT:          "-ftype-visibility="16// CHECK:            ]17// CHECK:            "name": "A"18// CHECK:          }19// CHECK-NOT:        "name": "A"20// CHECK:        "translation-units"21 22//--- cdb.json.template23[24  {25    "directory": "DIR",26    "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -fsyntax-only DIR/t1.c",27    "file": "DIR/t1.c"28  },29  {30    "directory": "DIR",31    "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -fvisibility=hidden -fsyntax-only DIR/t2.c",32    "file": "DIR/t2.c"33  },34  {35    "directory": "DIR",36    "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -fvisibility=hidden -fvisibility-ms-compat -fsyntax-only DIR/t3.c",37    "file": "DIR/t3.c"38  }39]40 41//--- modules/A/module.modulemap42 43module A {44  umbrella header "A.h"45}46 47//--- modules/A/A.h48 49typedef int A_t;50extern int a(void);51 52//--- t1.c53#include "A.h"54 55//--- t2.c56#include "A.h"57 58//--- t3.c59#include "A.h"60