brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · c6b7b19 Raw
112 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DIR|%/t|g" %t/build/compile-commands.json.in > %t/build/compile-commands.json4// RUN: clang-scan-deps -compilation-database %t/build/compile-commands.json \5// RUN:   -j 1 -format experimental-full --optimize-args=header-search,system-warnings,vfs,canonicalize-macros > %t/deps.db6// RUN: cat %t/deps.db | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t7 8// Check that there are two separate modules hashes. One for each working dir.9 10// CHECK:      {11// CHECK-NEXT:   "modules": [12// CHECK-NEXT:     {13// CHECK-NEXT:       "clang-module-deps":14// CHECK-NEXT:       "clang-modulemap-file":15// CHECK-NEXT:       "command-line": [16// CHECK:            ],17// CHECK-NEXT:       "context-hash": "{{.*}}",18// CHECK-NEXT:       "file-deps": [19// CHECK:            ],20// CHECK-NEXT:       "link-libraries": [],21// CHECK-NEXT:       "name": "A"22// CHECK-NEXT:     },23// CHECK-NEXT:     {24// CHECK-NEXT:       "clang-module-deps":25// CHECK-NEXT:       "clang-modulemap-file":26// CHECK-NEXT:       "command-line": [27// CHECK:            ],28// CHECK-NEXT:       "context-hash": "{{.*}}",29// CHECK-NEXT:       "file-deps": [30// CHECK:            ],31// CHECK-NEXT:       "link-libraries": [],32// CHECK-NEXT:       "name": "A"33// CHECK-NEXT:     },34// CHECK-NEXT:     {35// CHECK-NEXT:       "clang-module-deps":36// CHECK:            ],37// CHECK-NEXT:       "clang-modulemap-file":38// CHECK-NEXT:       "command-line": [39// CHECK:            ],40// CHECK-NEXT:       "context-hash": "{{.*}}",41// CHECK-NEXT:       "file-deps": [42// CHECK:            ],43// CHECK-NEXT:       "link-libraries": [],44// CHECK-NEXT:       "name": "B"45// CHECK-NEXT:     },46// CHECK-NEXT:     {47// CHECK-NEXT:       "clang-module-deps":48// CHECK:            ],49// CHECK-NEXT:       "clang-modulemap-file":50// CHECK-NEXT:       "command-line": [51// CHECK:            ],52// CHECK-NEXT:       "context-hash": "{{.*}}",53// CHECK-NEXT:       "file-deps": [54// CHECK:            ],55// CHECK-NEXT:       "link-libraries": [],56// CHECK-NEXT:       "name": "B"57// CHECK-NEXT:     }58// CHECK-NEXT:   ],59// CHECK-NEXT:   "translation-units": [60// CHECK:        ]61// CHECK:      }62 63//--- build/compile-commands.json.in64 65[66{67  "directory": "DIR/build",68  "command": "clang -c DIR/A.m -IDIR/modules/A -IDIR/modules/B -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-module-maps",69  "file": "DIR/A.m"70},71{72  "directory": "DIR",73  "command": "clang -c DIR/B.m -IDIR/modules/A -IDIR/modules/B -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-module-maps",74  "file": "DIR/B.m"75}76]77 78 79//--- modules/A/module.modulemap80 81module A {82  umbrella header "A.h"83}84 85//--- modules/A/A.h86 87typedef int A_t;88 89//--- modules/B/module.modulemap90 91module B {92  umbrella header "B.h"93}94 95//--- modules/B/B.h96 97#include <A.h>98 99typedef int B_t;100 101//--- A.m102 103#include <B.h>104 105A_t a = 0;106 107//--- B.m108 109#include <B.h>110 111B_t b = 0;112