1#===----------------------------------------------------------------------===## 2# 3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4# See https://llvm.org/LICENSE.txt for license information. 5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6# 7#===----------------------------------------------------------------------===## 8 9# Ensure that none of the standard C++ headers implicitly include cassert or 10# assert.h (because assert() is implemented as a macro). 11 12# RUN: %{python} %s %{libcxx}/utils 13 14import sys 15sys.path.append(sys.argv[1]) 16from libcxx.header_information import lit_header_restrictions, public_headers 17 18for header in public_headers: 19 if header == 'cassert': 20 continue 21 22 print(f"""\ 23//--- {header}.compile.pass.cpp 24{lit_header_restrictions.get(header, '')} 25 26#include <{header}> 27 28#ifdef assert 29# error "Do not include cassert or assert.h in standard header files" 30#endif 31""") 32