clang/test/Index/single-file-parse-undefined-function-like-macro.c
raw| 1 | // RUN: split-file %s %t |
| 2 | // RUN: c-index-test -single-file-parse %t/tu.c 2>&1 | FileCheck %t/tu.c |
| 3 | |
| 4 | //--- header.h |
| 5 | #define FUNCTION_LIKE_MACRO() 1 |
| 6 | //--- tu.c |
| 7 | #include "header.h" |
| 8 | // CHECK-NOT: tu.c:[[@LINE+1]]:5: error: function-like macro 'FUNCTION_LIKE_MACRO' is not defined |
| 9 | #if FUNCTION_LIKE_MACRO() |
| 10 | // CHECK: tu.c:[[@LINE+1]]:5: FunctionDecl=then_fn |
| 11 | int then_fn(); |
| 12 | #else |
| 13 | // CHECK: tu.c:[[@LINE+1]]:5: FunctionDecl=else_fn |
| 14 | int else_fn(); |
| 15 | #endif |