|
7 | 7 |
|
8 | 8 | // RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-context-hash/cdb_a.json.template > %t/cdb_a.json
|
9 | 9 | // RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-context-hash/cdb_b.json.template > %t/cdb_b.json
|
| 10 | +// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-context-hash/cdb_b2.json.template > %t/cdb_b2.json |
10 | 11 |
|
11 |
| -// We run two separate scans. The context hash for "a" and "b" can differ between |
| 12 | +// We run separate scans. The context hash for "a" and "b" can differ between |
12 | 13 | // systems. If we'd scan both Clang invocations in a single run, the order of JSON
|
13 | 14 | // entities would be non-deterministic. To prevent this, run the scans separately
|
14 | 15 | // and verify that the context hashes differ with a single FileCheck invocation.
|
15 | 16 | //
|
16 |
| -// RUN: clang-scan-deps -compilation-database %t/cdb_a.json -format experimental-full -j 1 > %t/result.json |
17 |
| -// RUN: clang-scan-deps -compilation-database %t/cdb_b.json -format experimental-full -j 1 >> %t/result.json |
18 |
| -// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK |
| 17 | +// RUN: clang-scan-deps -compilation-database %t/cdb_a.json -format experimental-full -j 1 > %t/result_a.json |
| 18 | +// RUN: clang-scan-deps -compilation-database %t/cdb_b.json -format experimental-full -j 1 > %t/result_b.json |
| 19 | +// RUN: clang-scan-deps -compilation-database %t/cdb_b2.json -format experimental-full -j 1 > %t/result_b2.json |
| 20 | +// RUN: cat %t/result_a.json %t/result_b.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK |
| 21 | +// RUN: cat %t/result_b.json %t/result_b2.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=FLAG_ONLY |
19 | 22 |
|
20 | 23 | // CHECK: {
|
21 | 24 | // CHECK-NEXT: "modules": [
|
|
91 | 94 | // CHECK-NEXT: ],
|
92 | 95 | // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
|
93 | 96 | // CHECK-NEXT: }
|
| 97 | + |
| 98 | +// B and B2 only differ by -fapplication-extension |
| 99 | + |
| 100 | +// FLAG_ONLY: "modules": [ |
| 101 | +// FLAG_ONLY-NEXT: { |
| 102 | +// FLAG_ONLY: "context-hash": "[[HASH_MOD_B1:.*]]" |
| 103 | +// FLAG_ONLY-NOT: "-fapplication-extension" |
| 104 | + |
| 105 | +// FLAG_ONLY: "modules": [ |
| 106 | +// FLAG_ONLY-NEXT: { |
| 107 | +// FLAG_ONLY-NOT: "context-hash": "[[HASH_MOD_B1]]" |
| 108 | +// FLAG_ONLY: "-fapplication-extension" |
| 109 | +// FLAG_ONLY: "translation-units": [ |
| 110 | +// FLAG_ONLY-NOT: "context-hash": "[[HASH_MOD_B1]]" |
0 commit comments