[cfe-commits] r119345 - in /cfe/trunk/test: CodeGen/lineno-dbginfo.c Preprocessor/clang_headers.c Preprocessor/has_include.c Preprocessor/header_lookup1.c Preprocessor/include-directive2.c Sema/attr-malloc.c Sema/i-c-e.c Sema/shift.c Sema/x86-builtin-palignr.c

Chandler Carruth chandlerc at gmail.com
Tue Nov 16 02:26:08 PST 2010


Author: chandlerc
Date: Tue Nov 16 04:26:08 2010
New Revision: 119345

URL: http://llvm.org/viewvc/llvm-project?rev=119345&view=rev
Log:
This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.

Modified:
    cfe/trunk/test/CodeGen/lineno-dbginfo.c
    cfe/trunk/test/Preprocessor/clang_headers.c
    cfe/trunk/test/Preprocessor/has_include.c
    cfe/trunk/test/Preprocessor/header_lookup1.c
    cfe/trunk/test/Preprocessor/include-directive2.c
    cfe/trunk/test/Sema/attr-malloc.c
    cfe/trunk/test/Sema/i-c-e.c
    cfe/trunk/test/Sema/shift.c
    cfe/trunk/test/Sema/x86-builtin-palignr.c

Modified: cfe/trunk/test/CodeGen/lineno-dbginfo.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lineno-dbginfo.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/lineno-dbginfo.c (original)
+++ cfe/trunk/test/CodeGen/lineno-dbginfo.c Tue Nov 16 04:26:08 2010
@@ -1,4 +1,4 @@
-// RUN: echo "#include <stdio.h>" > %t.h
+// RUN: echo "#include <stddef.h>" > %t.h
 // RUN: %clang -S -g -include %t.h %s -emit-llvm -o %t.ll
 // RUN: grep "i32 5" %t.ll
 // outer is at line number 5.

Modified: cfe/trunk/test/Preprocessor/clang_headers.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/clang_headers.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/clang_headers.c (original)
+++ cfe/trunk/test/Preprocessor/clang_headers.c Tue Nov 16 04:26:08 2010
@@ -1,3 +1,3 @@
-// RUN: %clang_cc1 -E %s
+// RUN: %clang_cc1 -ffreestanding -E %s
 
 #include <limits.h>

Modified: cfe/trunk/test/Preprocessor/has_include.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/has_include.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/has_include.c (original)
+++ cfe/trunk/test/Preprocessor/has_include.c Tue Nov 16 04:26:08 2010
@@ -1,23 +1,23 @@
-// RUN: %clang_cc1 -Eonly -verify %s
+// RUN: %clang_cc1 -ffreestanding -Eonly -verify %s
 
 // Try different path permutations of __has_include with existing file.
-#if __has_include("stdio.h")
+#if __has_include("stdint.h")
 #else
   #error "__has_include failed (1)."
 #endif
 
-#if __has_include(<stdio.h>)
+#if __has_include(<stdint.h>)
 #else
   #error "__has_include failed (2)."
 #endif
 
 // Try unary expression.
-#if !__has_include("stdio.h")
+#if !__has_include("stdint.h")
   #error "__has_include failed (5)."
 #endif
 
 // Try binary expression.
-#if __has_include("stdio.h") && __has_include("stddef.h")
+#if __has_include("stdint.h") && __has_include("stddef.h")
 #else
   #error "__has_include failed (6)."
 #endif
@@ -44,12 +44,12 @@
 #endif
 
 // Try unary expression.
-#if !__has_include_next("stdio.h") // expected-warning {{#include_next in primary source file}}
+#if !__has_include_next("stdint.h") // expected-warning {{#include_next in primary source file}}
   #error "__has_include_next failed (5)."
 #endif
 
 // Try binary expression.
-#if __has_include_next("stdio.h") && __has_include("stddef.h") // expected-warning {{#include_next in primary source file}}
+#if __has_include_next("stdint.h") && __has_include("stddef.h") // expected-warning {{#include_next in primary source file}}
 #else
   #error "__has_include_next failed (6)."
 #endif
@@ -68,16 +68,16 @@
 // FIXME: I don't quite know how to avoid preprocessor side effects.
 // Use FileCheck?
 // It also assert due to unterminated #if's.
-//#if __has_include("stdio.h"
-//#if __has_include "stdio.h")
-//#if __has_include(stdio.h)
+//#if __has_include("stdint.h"
+//#if __has_include "stdint.h")
+//#if __has_include(stdint.h)
 //#if __has_include()
 //#if __has_include(
 //#if __has_include)
 //#if __has_include
-//#if __has_include(<stdio.h>
-//#if __has_include<stdio.h>)
-//#if __has_include("stdio.h)
-//#if __has_include(stdio.h")
-//#if __has_include(<stdio.h)
-//#if __has_include(stdio.h>)
+//#if __has_include(<stdint.h>
+//#if __has_include<stdint.h>)
+//#if __has_include("stdint.h)
+//#if __has_include(stdint.h")
+//#if __has_include(<stdint.h)
+//#if __has_include(stdint.h>)

Modified: cfe/trunk/test/Preprocessor/header_lookup1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/header_lookup1.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/header_lookup1.c (original)
+++ cfe/trunk/test/Preprocessor/header_lookup1.c Tue Nov 16 04:26:08 2010
@@ -1,2 +1,2 @@
-// RUN: %clang -fno-ms-extensions -I /usr/include %s -E | grep 'stdio.h.*3.*4'
-#include <stdio.h>
+// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4'
+#include <stddef.h>

Modified: cfe/trunk/test/Preprocessor/include-directive2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/include-directive2.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/include-directive2.c (original)
+++ cfe/trunk/test/Preprocessor/include-directive2.c Tue Nov 16 04:26:08 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Eonly -verify %s 
+// RUN: %clang_cc1 -ffreestanding -Eonly -verify %s 
 #  define HEADER <float.h>
 
 #  include HEADER

Modified: cfe/trunk/test/Sema/attr-malloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-malloc.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-malloc.c (original)
+++ cfe/trunk/test/Sema/attr-malloc.c Tue Nov 16 04:26:08 2010
@@ -1,7 +1,10 @@
 // RUN: %clang -Xclang -verify -fsyntax-only %s
 // RUN: %clang -emit-llvm -S -o %t %s
 
-#include <stdlib.h>
+#include <stddef.h>
+
+// Declare malloc here explicitly so we don't depend on system headers.
+void * malloc(size_t) __attribute((malloc));
 
 int no_vars __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
 

Modified: cfe/trunk/test/Sema/i-c-e.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/i-c-e.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Sema/i-c-e.c (original)
+++ cfe/trunk/test/Sema/i-c-e.c Tue Nov 16 04:26:08 2010
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Xclang -verify -pedantic -fpascal-strings
+// RUN: %clang %s -ffreestanding -fsyntax-only -Xclang -verify -pedantic -fpascal-strings
 
 #include <stdint.h>
 #include <limits.h>

Modified: cfe/trunk/test/Sema/shift.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/shift.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Sema/shift.c (original)
+++ cfe/trunk/test/Sema/shift.c Tue Nov 16 04:26:08 2010
@@ -1,4 +1,4 @@
-// RUN: %clang -Wall -fsyntax-only -Xclang -verify %s
+// RUN: %clang -Wall -ffreestanding -fsyntax-only -Xclang -verify %s
 
 #include <limits.h>
 

Modified: cfe/trunk/test/Sema/x86-builtin-palignr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/x86-builtin-palignr.c?rev=119345&r1=119344&r2=119345&view=diff
==============================================================================
--- cfe/trunk/test/Sema/x86-builtin-palignr.c (original)
+++ cfe/trunk/test/Sema/x86-builtin-palignr.c Tue Nov 16 04:26:08 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -target-feature +ssse3 -verify %s
+// RUN: %clang_cc1 -ffreestanding -fsyntax-only -target-feature +ssse3 -verify %s
 // Temporarily xfail this on windows.
 // XFAIL: win32
 





More information about the cfe-commits mailing list