1 // This test checks that inferred frameworks/modules are accounted for in the
2 // scanner and can be explicitly built by Clang.
5 // RUN: split-file %s %t
7 //--- frameworks/Inferred.framework/Headers/Inferred.h
10 //--- frameworks/Inferred.framework/Frameworks/Sub.framework/Headers/Sub.h
12 //--- frameworks/module.modulemap
16 #include <Inferred/Inferred.h>
20 //--- cdb.json.template
24 "command": "clang -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -F DIR/frameworks -c DIR/tu.m -o DIR/tu.o"
27 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
28 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json
29 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
32 // CHECK-NEXT: "modules": [
34 // CHECK-NEXT: "clang-module-deps": [],
35 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/frameworks/module.modulemap",
36 // CHECK-NEXT: "command-line": [
38 // CHECK-NEXT: "context-hash": "{{.*}}",
39 // CHECK-NEXT: "file-deps": [
40 // CHECK-NEXT: "[[PREFIX]]/frameworks/Inferred.framework/Frameworks/Sub.framework/Headers/Sub.h",
41 // CHECK-NEXT: "[[PREFIX]]/frameworks/Inferred.framework/Headers/Inferred.h",
42 // CHECK-NEXT: "[[PREFIX]]/frameworks/module.modulemap"
44 // CHECK-NEXT: "name": "Inferred"
47 // CHECK-NEXT: "translation-units": [
49 // CHECK-NEXT: "commands": [
51 // CHECK-NEXT: "clang-context-hash": "{{.*}}",
52 // CHECK-NEXT: "clang-module-deps": [
54 // CHECK-NEXT: "context-hash": "{{.*}}",
55 // CHECK-NEXT: "module-name": "Inferred"
58 // CHECK-NEXT: "command-line": [
60 // CHECK: "file-deps": [
61 // CHECK-NEXT: "[[PREFIX]]/tu.m"
63 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.m"
70 // RUN: %deps-to-rsp %t/result.json --module-name=Inferred > %t/Inferred.cc1.rsp
71 // RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp
72 // RUN: %clang @%t/Inferred.cc1.rsp -pedantic -Werror
73 // RUN: %clang @%t/tu.rsp -pedantic -Werror