llvm-project/clang/test/Preprocessor/header-search-crash.c
Dmitry Polukhin b293c6280d [clang][Lexer] Fix crash/assert clang::HeaderSearch::search_dir_nth
The issue was introduced in D135801. When there are only header maps in the SearchDirs,
the out of bounds value is assigned to FirstNonHeaderMapSearchDirIdx.

Test Plan: check-clang

Differential Revision: https://reviews.llvm.org/D146156
2023-03-16 02:19:11 -07:00

6 lines
242 B
C

// RUN: rm -rf %t && mkdir %t
// RUN: %hmaptool write %S/Inputs/header-search-crash/foo.hmap.json %t/foo.hmap
// RUN: %clang -cc1 -E %s -I %t/foo.hmap -verify
#include "MissingHeader.h" // expected-error {{'MissingHeader.h' file not found}}