Include test files for rL318668

Forgotten when doing my SVN commit.

llvm-svn: 318694
This commit is contained in:
Erich Keane 2017-11-20 21:15:01 +00:00
parent c94d4d70d8
commit 86785bb0bb
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#ifndef _STDC_PREDEF_H
#define _STDC_PREDEF_H 1
#define DUMMY_STDC_PREDEF 1
#endif
#ifndef _STDC_PREDEF_H
#define _STDC_PREDEF_H 1
#define DUMMY_STDC_PREDEF 1
#endif

View File

@ -0,0 +1,25 @@
// Test that clang preincludes stdc-predef.h, if the include file is available
//
// RUN: %clang %s -### -c 2>&1 \
// RUN: --sysroot=%S/Inputs/stdc-predef \
// RUN: | FileCheck -check-prefix CHECK-PREDEF %s
// RUN: %clang %s -### -c -ffreestanding 2>&1 \
// RUN: --sysroot=%S/Inputs/stdc-predef \
// RUN: | FileCheck --implicit-check-not "stdc-predef.h" %s
// RUN: %clang %s -c -E 2>&1 \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --implicit-check-not "stdc-predef.h" %s
// RUN: %clang -c %s -Xclang -verify -DCHECK_DUMMY=1 \
// RUN: --sysroot=%S/Inputs/stdc-predef
// expected-no-diagnostics
// RUN: %clang -x cpp-output %s -### -c 2>&1 \
// RUN: --sysroot=%S/Inputs/stdc-predef \
// RUN: | FileCheck --implicit-check-not "stdc-predef.h" %s
// CHECK-PREDEF: "-fsystem-include-if-exists" "stdc-predef.h"
int i;
#if CHECK_DUMMY
#if !DUMMY_STDC_PREDEF
#error "Expected macro symbol DUMMY_STDC_PREDEF is not defined."
#endif
#endif

View File

@ -0,0 +1,16 @@
// The automatic preinclude of stdc-predef.h should not occur if
// the source filename indicates a preprocessed file.
//
// RUN: %clang %s -### -c 2>&1 \
// RUN: --sysroot=%S/Inputs/stdc-predef \
// RUN: | FileCheck --implicit-check-not "stdc-predef.h" %s
int i;
// The automatic preinclude of stdc-predef.h should not occur if
// the source filename indicates a preprocessed file.
//
// RUN: %clang %s -### -c 2>&1 \
// RUN: --sysroot=%S/Inputs/stdc-predef \
// RUN: | FileCheck --implicit-check-not "stdc-predef.h" %s
int i;