1 // Check that the scanner produces raw ast files, even when builds produce the 2 // obj format, and that the scanner can read obj format from PCH and modules 3 // imported by PCH. 4 5 // Unsupported on AIX because we don't support the requisite "__clangast" 6 // section in XCOFF yet. 7 // UNSUPPORTED: target={{.*}}-aix{{.*}} 8 9 // REQUIRES: shell 10 11 // RUN: rm -rf %t && mkdir %t 12 // RUN: cp %S/Inputs/modules-pch/* %t 13 14 // Scan dependencies of the PCH: 15 // 16 // RUN: rm -f %t/cdb_pch.json 17 // RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_pch.json > %t/cdb_pch.json 18 // RUN: clang-scan-deps -compilation-database %t/cdb_pch.json -format experimental-full \ 19 // RUN: -module-files-dir %t/build -o %t/result_pch.json 20 21 // Explicitly build the PCH: 22 // 23 // RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon1 > %t/mod_common_1.cc1.rsp 24 // RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon2 > %t/mod_common_2.cc1.rsp 25 // RUN: %deps-to-rsp %t/result_pch.json --module-name=ModPCH > %t/mod_pch.cc1.rsp 26 // RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp 27 // 28 // RUN: %clang @%t/mod_common_1.cc1.rsp 29 // RUN: %clang @%t/mod_common_2.cc1.rsp 30 // RUN: %clang @%t/mod_pch.cc1.rsp 31 // RUN: %clang @%t/pch.rsp 32 33 // Scan dependencies of the TU: 34 // 35 // RUN: rm -f %t/cdb_tu.json 36 // RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_tu.json > %t/cdb_tu.json 37 // RUN: clang-scan-deps -compilation-database %t/cdb_tu.json -format experimental-full \ 38 // RUN: -module-files-dir %t/build > %t/result_tu.json 39 40 // Explicitly build the TU: 41 // 42 // RUN: %deps-to-rsp %t/result_tu.json --module-name=ModTU > %t/mod_tu.cc1.rsp 43 // RUN: %deps-to-rsp %t/result_tu.json --tu-index=0 > %t/tu.rsp 44 // 45 // RUN: %clang @%t/mod_tu.cc1.rsp 46 // RUN: %clang @%t/tu.rsp 47 48 // Check the module format for scanner modules: 49 // 50 // RUN: find %t/cache -name "*.pcm" -exec %clang_cc1 -module-file-info "{}" ";" | FileCheck %s -check-prefix=SCAN 51 // SCAN: Module format: raw 52 // SCAN: Module format: raw 53 // SCAN: Module format: raw 54 // SCAN: Module format: raw 55 56 // Check the module format for built modules: 57 // 58 // RUN: find %t/build -name "*.pcm" -exec %clang_cc1 -module-file-info "{}" ";" | FileCheck %s -check-prefix=BUILD 59 // BUILD: Module format: obj 60 // BUILD: Module format: obj 61 // BUILD: Module format: obj 62 // BUILD: Module format: obj 63 64 // FIXME: check pch format as well; -module-file-info does not work with a PCH 65