| 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir %t |
| 3 | // RUN: env CINDEXTEST_INVOCATION_EMISSION_PATH=%t not c-index-test -test-load-source all %s |
| 4 | // RUN: cat %t/libclang-* | FileCheck %s |
| 5 | |
| 6 | // RUN: rm -rf %t |
| 7 | // RUN: mkdir %t |
| 8 | // RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 CINDEXTEST_INVOCATION_EMISSION_PATH=%t not --crash c-index-test -test-load-source all %s |
| 9 | // RUN: cat %t/libclang-* | FileCheck %s |
| 10 | |
| 11 | // Verify that the file is removed for successful operation: |
| 12 | // RUN: rm -rf %t |
| 13 | // RUN: mkdir %t |
| 14 | // RUN: env CINDEXTEST_INVOCATION_EMISSION_PATH=%t c-index-test -test-load-source all %s -DAVOID_CRASH |
| 15 | // RUN: ls %t | count 0 |
| 16 | |
| 17 | // Make sure we record the unsaved file hash. |
| 18 | // RUN: rm -rf %t |
| 19 | // RUN: mkdir %t |
| 20 | // RUN: env CINDEXTEST_INVOCATION_EMISSION_PATH=%t not c-index-test -test-load-source all "-remap-file=%s,%S/Inputs/record-parsing-invocation-remap.c" %s |
| 21 | // RUN: cat %t/libclang-* | FileCheck --check-prefix=CHECK-UNSAVED %s |
| 22 | |
| 23 | #ifndef AVOID_CRASH |
| 24 | # pragma clang __debug parser_crash |
| 25 | #endif |
| 26 | |
| 27 | // CHECK: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"]} |
| 28 | // CHECK-UNSAVED: {"toolchain":"{{.*}}","libclang.operation":"parse","libclang.opts":1,"args":["clang","-fno-spell-checking","{{.*}}record-parsing-invocation.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"],"unsaved_file_hashes":[{"name":"{{.*}}record-parsing-invocation.c","md5":"aee23773de90e665992b48209351d70e"}]} |
| 29 | |