]> granicus.if.org Git - clang/commitdiff
This really seems like a boring set of fixes to our tests to make them more
authorChandler Carruth <chandlerc@gmail.com>
Tue, 16 Nov 2010 10:26:08 +0000 (10:26 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 16 Nov 2010 10:26:08 +0000 (10:26 +0000)
independent of the underlying system. Let me know if any of these are too
aggressive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119345 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 176d4157f39ded5533f1bf40e69f06db3536a8fc..72fa337eaf83d1dd7f74ca376a5cb1cafe31e789 100644 (file)
@@ -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.
index f2dec4fbe565ef97e10fd69927aab92585a7c974..41bd7541045816dc7ecb4e046de636e255b458ce 100644 (file)
@@ -1,3 +1,3 @@
-// RUN: %clang_cc1 -E %s
+// RUN: %clang_cc1 -ffreestanding -E %s
 
 #include <limits.h>
index c34c3488036a3cf260b9473435b756427f9caed0..fdcae78b751e1e1b5c31f18eacdb2079c8bd93ad 100644 (file)
@@ -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
 #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
 // 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>)
index f93d0afe331ea8ee53533aa2065c48b2105cf59a..f52e4fe6ce92eb6709d28441be873ce03d184f34 100644 (file)
@@ -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>
index b205325f601ed4c45cf2aea431e5bd129d68b7d8..5f1ee3cfbc26b9e3eb8653814dc26582663d2d03 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Eonly -verify %s 
+// RUN: %clang_cc1 -ffreestanding -Eonly -verify %s 
 #  define HEADER <float.h>
 
 #  include HEADER
index 9970b9de4f95af6619c1e52c96c61e473c35671f..2cec84de496918f1ff957cf0e9b843c294370a52 100644 (file)
@@ -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}}
 
index 1347ee85e0a6512dc407096ccb013ed8d89e0280..4c2962d4b21a894988e791e0c9e749af1874195e 100644 (file)
@@ -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>
index 558a7d20065a27bd2f8eceb4f4da3f41691961f3..4273cab98ee39b23a547b3372435ca896aa032ab 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -Wall -fsyntax-only -Xclang -verify %s
+// RUN: %clang -Wall -ffreestanding -fsyntax-only -Xclang -verify %s
 
 #include <limits.h>
 
index 8f90c81fd8a36d61fee53056a3fb080ea26c59a8..a703c800abd0c0f2b1677f380a87380d77ad5e5a 100644 (file)
@@ -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