1 // This test checks that ordering of TUs in the input CDB is preserved in the full output.
4 // RUN: split-file %s %t
6 //--- cdb.json.template
11 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -c DIR/tu.c -DONE -o DIR/tu1.o"
16 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -c DIR/tu.c -DTWO -o DIR/tu2.o"
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
27 // CHECK-NEXT: "modules": [],
28 // CHECK-NEXT: "translation-units": [
30 // CHECK-NEXT: "commands": [
32 // CHECK-NEXT: "clang-context-hash": "{{.*}}",
33 // CHECK-NEXT: "clang-module-deps": [],
34 // CHECK-NEXT: "command-line": [
38 // CHECK: "file-deps": [
39 // CHECK-NEXT: "[[PREFIX]]/tu.c"
41 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
46 // CHECK-NEXT: "commands": [
48 // CHECK-NEXT: "clang-context-hash": "{{.*}}",
49 // CHECK-NEXT: "clang-module-deps": [],
50 // CHECK-NEXT: "command-line": [
54 // CHECK: "file-deps": [
55 // CHECK-NEXT: "[[PREFIX]]/tu.c"
57 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"