[lldb] Use llvm::Error instead of CommandReturnObject for error reporting (#125125)
[llvm-project.git] / clang / test / ClangScanDeps / strip-visibility.c
blob3c8de700b12bab1ab495c1469cf53f7d2f2257a4
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
5 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -mode preprocess-dependency-directives > %t/result.txt
7 // RUN: FileCheck %s -input-file %t/result.txt
9 // Verify that there's a single version of module A.
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"
22 //--- cdb.json.template
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"
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"
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"
41 //--- modules/A/module.modulemap
43 module A {
44 umbrella header "A.h"
47 //--- modules/A/A.h
49 typedef int A_t;
50 extern int a(void);
52 //--- t1.c
53 #include "A.h"
55 //--- t2.c
56 #include "A.h"
58 //--- t3.c
59 #include "A.h"