From e0bde7554ce04ef7af99c69d526882a56f54a928 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 27 Oct 2016 14:17:10 +0000 Subject: Do not print include_next/pragma once warnings when input is a header. r276653 suppressed the pragma once warning when generating a PCH file. This patch extends that to any main file for which clang is told (with the -x option) that it's a header file. It will also suppress the warning "#include_next in primary source file". Differential Revision: http://reviews.llvm.org/D25989 llvm-svn: 285295 --- clang/test/Preprocessor/header_is_main_file.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clang/test/Preprocessor/header_is_main_file.c (limited to 'clang/test') diff --git a/clang/test/Preprocessor/header_is_main_file.c b/clang/test/Preprocessor/header_is_main_file.c new file mode 100644 index 00000000000..03ade13ff33 --- /dev/null +++ b/clang/test/Preprocessor/header_is_main_file.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -x c-header -ffreestanding -Eonly -verify %s +// expected-no-diagnostics + +#pragma once +#include_next "stdint.h" +#if !__has_include_next("stdint.h") +#error "__has_include_next failed" +#endif -- cgit v1.2.3