Clang Project

clang_source_code/test/VFS/vfsroot-include.c
1// REQUIRES: shell
2// RUN: rm -rf %t
3// RUN: mkdir -p %t
4// RUN: sed -e "s:TEST_DIR:%S:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsroot.yaml > %t.yaml
5// RUN: not %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %S/Inputs -I /direct-vfs-root-files -fsyntax-only /tests/vfsroot-include.c 2>&1 | FileCheck %s
6// The line above tests that the compiler input file is looked up through VFS.
7
8// Test successful include through the VFS.
9#include "not_real.h"
10
11// Test that a file missing from the VFS root is not found, even if it is
12// discoverable through the real file system. Fatal error should be the last
13// in the file as it hides other errors.
14#include "actual_header.h"
15// CHECK: fatal error: 'actual_header.h' file not found
16// CHECK: 1 error generated.
17// CHECK-NOT: error
18