[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ClangScanDeps / modules-full-output-tu-order.c
blob065b8ac8ae07f01a9b679f80e490d1590185b28b
1 // This test checks that ordering of TUs in the input CDB is preserved in the full output.
3 // RUN: rm -rf %t
4 // RUN: split-file %s %t
6 //--- cdb.json.template
9 "directory": "DIR",
10 "file": "DIR/tu.c",
11 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -c DIR/tu.c -DONE -o DIR/tu1.o"
14 "directory": "DIR",
15 "file": "DIR/tu.c",
16 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -c DIR/tu.c -DTWO -o DIR/tu2.o"
20 //--- tu.c
22 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
23 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json
24 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
26 // CHECK: {
27 // CHECK-NEXT: "modules": [],
28 // CHECK-NEXT: "translation-units": [
29 // CHECK-NEXT: {
30 // CHECK-NEXT: "commands": [
31 // CHECK-NEXT: {
32 // CHECK-NEXT: "clang-context-hash": "{{.*}}",
33 // CHECK-NEXT: "clang-module-deps": [],
34 // CHECK-NEXT: "command-line": [
35 // CHECK: "-D"
36 // CHECK-NEXT: "ONE"
37 // CHECK: ],
38 // CHECK: "file-deps": [
39 // CHECK-NEXT: "[[PREFIX]]/tu.c"
40 // CHECK-NEXT: ],
41 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
42 // CHECK-NEXT: }
43 // CHECK: ]
44 // CHECK: },
45 // CHECK-NEXT: {
46 // CHECK-NEXT: "commands": [
47 // CHECK-NEXT: {
48 // CHECK-NEXT: "clang-context-hash": "{{.*}}",
49 // CHECK-NEXT: "clang-module-deps": [],
50 // CHECK-NEXT: "command-line": [
51 // CHECK: "-D"
52 // CHECK-NEXT: "TWO"
53 // CHECK: ],
54 // CHECK: "file-deps": [
55 // CHECK-NEXT: "[[PREFIX]]/tu.c"
56 // CHECK-NEXT: ],
57 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
58 // CHECK: }
59 // CHECK: ]
60 // CHECK: }
61 // CHECK: ]
62 // CHECK: }