r318694 - Include test files for rL318668
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 20 13:15:01 PST 2017
Author: erichkeane
Date: Mon Nov 20 13:15:01 2017
New Revision: 318694
URL: http://llvm.org/viewvc/llvm-project?rev=318694&view=rev
Log:
Include test files for rL318668
Forgotten when doing my SVN commit.
Added:
cfe/trunk/test/Driver/Inputs/stdc-predef/
cfe/trunk/test/Driver/Inputs/stdc-predef/usr/
cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/
cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h (with props)
cfe/trunk/test/Driver/stdc-predef.c (with props)
cfe/trunk/test/Driver/stdc-predef.i
Added: cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h?rev=318694&view=auto
==============================================================================
--- cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h (added)
+++ cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h Mon Nov 20 13:15:01 2017
@@ -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
Propchange: cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: cfe/trunk/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cfe/trunk/test/Driver/stdc-predef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/stdc-predef.c?rev=318694&view=auto
==============================================================================
--- cfe/trunk/test/Driver/stdc-predef.c (added)
+++ cfe/trunk/test/Driver/stdc-predef.c Mon Nov 20 13:15:01 2017
@@ -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
Propchange: cfe/trunk/test/Driver/stdc-predef.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/trunk/test/Driver/stdc-predef.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: cfe/trunk/test/Driver/stdc-predef.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cfe/trunk/test/Driver/stdc-predef.i
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/stdc-predef.i?rev=318694&view=auto
==============================================================================
--- cfe/trunk/test/Driver/stdc-predef.i (added)
+++ cfe/trunk/test/Driver/stdc-predef.i Mon Nov 20 13:15:01 2017
@@ -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;
More information about the cfe-commits
mailing list