15 lines · cpp
1// Test that a [no_undeclared_headers] module can include builtin headers, even2// if these have been "claimed" by a different module that wraps these builtin3// headers. libc++ does this, for example.4//5// The test inputs used here replicates the relationship between libc++ and6// glibc. When modularizing glibc, [no_undeclared_headers] must be used to7// prevent glibc from including the libc++ versions of the C standard library8// headers.9 10// RUN: rm -rf %t11// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fbuiltin-headers-in-system-modules -fimplicit-module-maps -I %S/Inputs/no-undeclared-includes-builtins/libcxx -I %S/Inputs/no-undeclared-includes-builtins/glibc %s12// expected-no-diagnostics13 14#include <stddef.h>15