[ORC-RT][LoongArch] Add initial support for loongarch64 in ELFNixPlatform (#123575)
[llvm-project.git] / clang / test / ClangScanDeps / modules-implicit-dot-private.m
blobaa8caf3451dc4a454a78840ed3b6a9e221c3fad4
1 // This test checks that modules loaded during compilation (but not imported)
2 // are still reported as dependencies.
4 // RUN: rm -rf %t && mkdir %t
5 // RUN: split-file %s %t
7 //--- frameworks/FW.framework/Modules/module.modulemap
8 framework module FW { umbrella header "FW.h" }
9 //--- frameworks/FW.framework/Headers/FW.h
10 //--- frameworks/FW.framework/Modules/module.private.modulemap
11 framework module FW_Private { umbrella header "FW_Private.h" }
12 //--- frameworks/FW.framework/PrivateHeaders/FW_Private.h
14 //--- cdb.json.template
16   "file": "DIR/tu.m",
17   "directory": "DIR",
18   "command": "clang -fmodules -fmodules-cache-path=DIR/cache -F DIR/frameworks -c DIR/tu.m -o DIR/tu.o"
20 //--- tu.m
21 @import FW.Private;
23 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
24 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json
25 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
26 // CHECK:      {
27 // CHECK-NEXT:   "modules": [
28 // CHECK-NEXT:     {
29 // CHECK:            "clang-module-deps": [],
30 // CHECK-NEXT:       "clang-modulemap-file": "[[PREFIX]]/frameworks/FW.framework/Modules/module.modulemap",
31 // CHECK-NEXT:       "command-line": [
32 // CHECK:            ],
33 // CHECK-NEXT:       "context-hash": "{{.*}}",
34 // CHECK:            "file-deps": [
35 // CHECK-NEXT:         "[[PREFIX]]/frameworks/FW.framework/Modules/module.modulemap",
36 // CHECK-NEXT:         "[[PREFIX]]/frameworks/FW.framework/Headers/FW.h"
37 // CHECK-NEXT:       ],
38 // CHECK-NEXT:       "link-libraries": [
39 // CHECK-NEXT:         {
40 // CHECK-NEXT:           "isFramework": true,
41 // CHECK-NEXT:           "link-name": "FW"
42 // CHECK-NEXT:         }
43 // CHECK-NEXT:       ],
44 // CHECK-NEXT:       "name": "FW"
45 // CHECK:          },
46 // CHECK:          {
47 // CHECK:            "clang-module-deps": [],
48 // CHECK-NEXT:       "clang-modulemap-file": "[[PREFIX]]/frameworks/FW.framework/Modules/module.private.modulemap",
49 // CHECK-NEXT:       "command-line": [
50 // CHECK:            ],
51 // CHECK-NEXT:       "context-hash": "{{.*}}",
52 // CHECK:            "file-deps": [
53 // CHECK-NEXT:         "[[PREFIX]]/frameworks/FW.framework/Modules/module.private.modulemap",
54 // CHECK-NEXT:         "[[PREFIX]]/frameworks/FW.framework/PrivateHeaders/FW_Private.h"
55 // CHECK-NEXT:       ],
56 // CHECK-NEXT:       "link-libraries": [
57 // CHECK-NEXT:         {
58 // CHECK-NEXT:           "isFramework": true,
59 // CHECK-NEXT:           "link-name": "FW"
60 // CHECK-NEXT:         }
61 // CHECK-NEXT:       ],
62 // CHECK-NEXT:       "name": "FW_Private"
63 // CHECK:           }
64 // CHECK:        ],
65 // CHECK-NEXT:   "translation-units": [
66 // CHECK-NEXT:     {
67 // CHECK:            "clang-context-hash": "{{.*}}",
68 // CHECK-NEXT:       "clang-module-deps": [
69 // CHECK-NEXT:         {
70 // CHECK-NEXT:           "context-hash": "{{.*}}",
71 // CHECK-NEXT:           "module-name": "FW"
72 // CHECK-NEXT:         },
73 // CHECK-NEXT:         {
74 // CHECK-NEXT:           "context-hash": "{{.*}}",
75 // CHECK-NEXT:           "module-name": "FW_Private"
76 // CHECK-NEXT:         }
77 // CHECK-NEXT:       ],
78 // CHECK-NEXT:       "command-line": [
79 // CHECK:              "-fmodule-file={{.*}}/FW-{{.*}}.pcm"
80 // CHECK:              "-fmodule-file={{.*}}/FW_Private-{{.*}}.pcm"
81 // CHECK:            ],
82 // CHECK:            "file-deps": [
83 // CHECK-NEXT:         "[[PREFIX]]/tu.m"
84 // CHECK-NEXT:       ],
85 // CHECK-NEXT:       "input-file": "[[PREFIX]]/tu.m"
86 // CHECK-NEXT:     }
88 // RUN: %deps-to-rsp %t/result.json --module-name=FW > %t/FW.cc1.rsp
89 // RUN: %deps-to-rsp %t/result.json --module-name=FW_Private > %t/FW_Private.cc1.rsp
90 // RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp
91 // RUN: %clang @%t/FW.cc1.rsp
92 // RUN: %clang @%t/FW_Private.cc1.rsp
93 // RUN: %clang @%t/tu.rsp