[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / ClangScanDeps / modules-context-hash-warnings.c
blob09d2f20b329e373d6ed73433d79e70303765909a
1 // Differences in -W warning options should result in different canonical module
2 // build commands.
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
9 // RUN: -format experimental-full > %t/deps.json
10 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
12 // CHECK: {
13 // CHECK-NEXT: "modules": [
14 // CHECK: {
15 // CHECK: "command-line": [
16 // CHECK: "-Wall"
17 // CHECK: ]
18 // CHECK: "context-hash": "[[HASH1:.*]]"
19 // CHECK: "name": "Mod"
20 // CHECK-NEXT: }
21 // CHECK-NEXT: {
22 // CHECK: "command-line": [
23 // CHECK-NOT: "-Wall"
24 // CHECK: ]
25 // CHECK: "context-hash": "[[HASH2:.*]]"
26 // CHECK: "name": "Mod"
27 // CHECK-NEXT: }
28 // CHECK-NEXT: ]
29 // CHECK-NEXT: "translation-units": [
30 // CHECK-NEXT: {
31 // CHECK: "clang-module-deps": [
32 // CHECK-NEXT: {
33 // CHECK-NEXT: "context-hash": "[[HASH1]]"
34 // CHECK-NEXT: "module-name": "Mod"
35 // CHECK-NEXT: }
36 // CHECK-NEXT: ]
37 // CHECK-NEXT: "command-line": [
38 // CHECK: "-Wall"
39 // CHECK: ]
40 // CHECK: "input-file": "{{.*}}tu1.c"
41 // CHECK-NEXT: }
42 // CHECK: {
43 // CHECK: "clang-module-deps": [
44 // CHECK-NEXT: {
45 // CHECK-NEXT: "context-hash": "[[HASH2]]"
46 // CHECK-NEXT: "module-name": "Mod"
47 // CHECK-NEXT: }
48 // CHECK-NEXT: ]
49 // CHECK-NEXT: "command-line": [
50 // CHECK-NOT: "-Wall"
51 // CHECK: ]
52 // CHECK: "input-file": "{{.*}}tu2.c"
54 //--- cdb.json.template
57 "directory": "DIR",
58 "command": "clang -Wall -fsyntax-only DIR/tu1.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
59 "file": "DIR/tu1.c"
62 "directory": "DIR",
63 "command": "clang -fsyntax-only DIR/tu2.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
64 "file": "DIR/tu2.c"
68 //--- module.modulemap
69 module Mod { header "Mod.h" }
71 //--- Mod.h
73 //--- tu1.c
74 #include "Mod.h"
76 //--- tu2.c
77 #include "Mod.h"