summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-17 08:57:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-17 08:57:36 +0000
commitfeedba68b542fb4797875340b22cd81efb9cd0f4 (patch)
tree8376a3dc0d8b7e99ed05583aaf90896a73a81471
parentf85fabec35026158a8a5490100cf2b07c93c7a43 (diff)
downloadbcm5719-llvm-feedba68b542fb4797875340b22cd81efb9cd0f4.tar.gz
bcm5719-llvm-feedba68b542fb4797875340b22cd81efb9cd0f4.zip
Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.
llvm-svn: 89070
-rw-r--r--clang/test/Analysis/ObjCRetSigs.m2
-rw-r--r--clang/test/CodeGen/PR3589-freestanding-libcalls.c2
-rw-r--r--clang/test/CodeGen/blocks-1.c2
-rw-r--r--clang/test/CodeGen/builtins.c2
-rw-r--r--clang/test/CodeGen/constructor-attribute.c2
-rw-r--r--clang/test/CodeGen/mandel.c2
-rw-r--r--clang/test/CodeGen/predefined-expr.c2
-rw-r--r--clang/test/CodeGen/volatile-1.c2
-rw-r--r--clang/test/CodeGenObjC/dot-syntax-1.m2
-rw-r--r--clang/test/CodeGenObjC/dot-syntax.m2
-rw-r--r--clang/test/CodeGenObjC/messages-2.m2
-rw-r--r--clang/test/CodeGenObjC/property.m2
-rw-r--r--clang/test/Lexer/digraph.c2
-rw-r--r--clang/test/Parser/block-block-storageclass.c2
-rw-r--r--clang/test/Preprocessor/header_lookup1.c2
-rw-r--r--clang/test/Preprocessor/objc-pp.m2
-rw-r--r--clang/test/Sema/attr-format_arg.c2
-rw-r--r--clang/test/Sema/block-byref-args.c2
-rw-r--r--clang/test/Sema/block-storageclass.c2
-rw-r--r--clang/test/Sema/check-increment.c2
-rw-r--r--clang/test/Sema/format-attr-pr4470.c2
-rw-r--r--clang/test/Sema/format-strings.c19
-rw-r--r--clang/test/Sema/ucn-cstring.c2
-rw-r--r--clang/test/SemaObjC/unused.m5
24 files changed, 36 insertions, 32 deletions
diff --git a/clang/test/Analysis/ObjCRetSigs.m b/clang/test/Analysis/ObjCRetSigs.m
index 3ee13e0e63e..60a85fd791e 100644
--- a/clang/test/Analysis/ObjCRetSigs.m
+++ b/clang/test/Analysis/ObjCRetSigs.m
@@ -1,6 +1,6 @@
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-methodsigs -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface MyBase
-(long long)length;
diff --git a/clang/test/CodeGen/PR3589-freestanding-libcalls.c b/clang/test/CodeGen/PR3589-freestanding-libcalls.c
index b2d22753791..14608137188 100644
--- a/clang/test/CodeGen/PR3589-freestanding-libcalls.c
+++ b/clang/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -2,7 +2,7 @@
// RUN: clang-cc -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
// RUN: clang-cc -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
-#include <stdio.h>
+int printf(const char *, ...);
void f0() {
printf("hello\n");
diff --git a/clang/test/CodeGen/blocks-1.c b/clang/test/CodeGen/blocks-1.c
index 5b639d10beb..ae5a74aab6f 100644
--- a/clang/test/CodeGen/blocks-1.c
+++ b/clang/test/CodeGen/blocks-1.c
@@ -7,7 +7,7 @@
// RUN: grep "i32 135)" %t | count 2
// RUN: grep "_Block_object_assign" %t | count 10
-#include <stdio.h>
+int printf(const char *, ...);
void test1() {
__block int a;
diff --git a/clang/test/CodeGen/builtins.c b/clang/test/CodeGen/builtins.c
index b4db48ae4b2..11bcc14249a 100644
--- a/clang/test/CodeGen/builtins.c
+++ b/clang/test/CodeGen/builtins.c
@@ -1,7 +1,7 @@
// RUN: clang-cc -emit-llvm -o %t %s
// RUN: not grep __builtin %t
-#include <stdio.h>
+int printf(const char *, ...);
void p(char *str, int x) {
printf("%s: %d\n", str, x);
diff --git a/clang/test/CodeGen/constructor-attribute.c b/clang/test/CodeGen/constructor-attribute.c
index 69e7063eab2..b715201dc53 100644
--- a/clang/test/CodeGen/constructor-attribute.c
+++ b/clang/test/CodeGen/constructor-attribute.c
@@ -4,7 +4,7 @@
// RUN: grep -e "global_ctors.*@C" %t
// RUN: grep -e "global_dtors.*@D" %t
-#include <stdio.h>
+int printf(const char *, ...);
void A() __attribute__((constructor));
void B() __attribute__((destructor));
diff --git a/clang/test/CodeGen/mandel.c b/clang/test/CodeGen/mandel.c
index 27993f0559e..9d7956c56d1 100644
--- a/clang/test/CodeGen/mandel.c
+++ b/clang/test/CodeGen/mandel.c
@@ -25,7 +25,7 @@ int main() { return 0; }
#define I 1.0iF
-#include <stdio.h>
+int putchar(char c);
volatile double __complex__ accum;
diff --git a/clang/test/CodeGen/predefined-expr.c b/clang/test/CodeGen/predefined-expr.c
index 9b645931a4a..1a5dcb4fc6f 100644
--- a/clang/test/CodeGen/predefined-expr.c
+++ b/clang/test/CodeGen/predefined-expr.c
@@ -9,7 +9,7 @@
// CHECK: @__func__.staticFunction = private constant [15 x i8] c"staticFunction\00"
// CHECK: @__PRETTY_FUNCTION__.staticFunction = private constant [22 x i8] c"void staticFunction()\00"
-#include <stdio.h>
+int printf(const char *, ...);
void plainFunction() {
printf("__func__ %s\n", __func__);
diff --git a/clang/test/CodeGen/volatile-1.c b/clang/test/CodeGen/volatile-1.c
index 9df11d249da..3203326eceb 100644
--- a/clang/test/CodeGen/volatile-1.c
+++ b/clang/test/CodeGen/volatile-1.c
@@ -14,7 +14,7 @@ volatile struct S {
} a, b;
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
-#include <stdio.h>
+int printf(const char *, ...);
int main() {
// A use.
diff --git a/clang/test/CodeGenObjC/dot-syntax-1.m b/clang/test/CodeGenObjC/dot-syntax-1.m
index 491ea0a5a63..6fab03935be 100644
--- a/clang/test/CodeGenObjC/dot-syntax-1.m
+++ b/clang/test/CodeGenObjC/dot-syntax-1.m
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/clang/test/CodeGenObjC/dot-syntax.m b/clang/test/CodeGenObjC/dot-syntax.m
index bd61a6aaf95..348346b8fca 100644
--- a/clang/test/CodeGenObjC/dot-syntax.m
+++ b/clang/test/CodeGenObjC/dot-syntax.m
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/clang/test/CodeGenObjC/messages-2.m b/clang/test/CodeGenObjC/messages-2.m
index 02dbd01df8f..5cf4d2df221 100644
--- a/clang/test/CodeGenObjC/messages-2.m
+++ b/clang/test/CodeGenObjC/messages-2.m
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
@end
diff --git a/clang/test/CodeGenObjC/property.m b/clang/test/CodeGenObjC/property.m
index 8ac44f1c794..59f096f5c59 100644
--- a/clang/test/CodeGenObjC/property.m
+++ b/clang/test/CodeGenObjC/property.m
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
diff --git a/clang/test/Lexer/digraph.c b/clang/test/Lexer/digraph.c
index 4d494ca1dd9..3c92db1c02b 100644
--- a/clang/test/Lexer/digraph.c
+++ b/clang/test/Lexer/digraph.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify < %s
-%:include <stdio.h>
+%:include <stdint.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512
diff --git a/clang/test/Parser/block-block-storageclass.c b/clang/test/Parser/block-block-storageclass.c
index d24ec5f1c69..df9423460cd 100644
--- a/clang/test/Parser/block-block-storageclass.c
+++ b/clang/test/Parser/block-block-storageclass.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify -parse-noop %s
#if 0
-#include <stdio.h>
+int printf(const char *, ...);
void _Block_byref_release(void*src){}
int main() {
diff --git a/clang/test/Preprocessor/header_lookup1.c b/clang/test/Preprocessor/header_lookup1.c
index df58a6ea9c5..10049adcd37 100644
--- a/clang/test/Preprocessor/header_lookup1.c
+++ b/clang/test/Preprocessor/header_lookup1.c
@@ -1,2 +1,2 @@
-// RUN: clang-cc -I /usr/include %s -E | grep 'stdio.h.*3.*4'
+// RUN: clang -I /usr/include %s -E | grep 'stdio.h.*3.*4'
#include <stdio.h>
diff --git a/clang/test/Preprocessor/objc-pp.m b/clang/test/Preprocessor/objc-pp.m
index 4ab2f07cef2..977789e38f1 100644
--- a/clang/test/Preprocessor/objc-pp.m
+++ b/clang/test/Preprocessor/objc-pp.m
@@ -1,4 +1,4 @@
// RUN: clang-cc %s -fsyntax-only -verify -pedantic
-#import <limits.h> // no warning on #import in objc mode.
+#import <stdint.h> // no warning on #import in objc mode.
diff --git a/clang/test/Sema/attr-format_arg.c b/clang/test/Sema/attr-format_arg.c
index 0830951acc8..5f06f4ba3fc 100644
--- a/clang/test/Sema/attr-format_arg.c
+++ b/clang/test/Sema/attr-format_arg.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
const char* f(const char *s) __attribute__((format_arg(1)));
diff --git a/clang/test/Sema/block-byref-args.c b/clang/test/Sema/block-byref-args.c
index 39745d54efa..06bab121f91 100644
--- a/clang/test/Sema/block-byref-args.c
+++ b/clang/test/Sema/block-byref-args.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-#include <stdio.h>
+int printf(const char *, ...);
int main(int argc, char **argv) {
__block void(*bobTheFunction)(void);
diff --git a/clang/test/Sema/block-storageclass.c b/clang/test/Sema/block-storageclass.c
index 3d2527b3f4e..aacf8be2c06 100644
--- a/clang/test/Sema/block-storageclass.c
+++ b/clang/test/Sema/block-storageclass.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-#include <stdio.h>
+int printf(const char *, ...);
void _Block_byref_release(void*src){}
int main() {
diff --git a/clang/test/Sema/check-increment.c b/clang/test/Sema/check-increment.c
index 9809544854d..72eae06bfa1 100644
--- a/clang/test/Sema/check-increment.c
+++ b/clang/test/Sema/check-increment.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
typedef int *pint;
int main() {
int a[5] = {0};
diff --git a/clang/test/Sema/format-attr-pr4470.c b/clang/test/Sema/format-attr-pr4470.c
index c03c573b727..24eece8878e 100644
--- a/clang/test/Sema/format-attr-pr4470.c
+++ b/clang/test/Sema/format-attr-pr4470.c
@@ -1,7 +1,7 @@
// RUN: clang-cc -fsyntax-only -verify -Wformat=2 %s
-#include <stdio.h>
#include <stdarg.h>
+int vprintf(const char *, va_list);
const char *foo(const char *format) __attribute__((format_arg(1)));
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 797e53c1bd2..0a9fccebd7f 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -1,17 +1,20 @@
// RUN: clang-cc -fsyntax-only -verify -Wformat-nonliteral %s
-// Define this to get vasprintf on Linux
-#define _GNU_SOURCE
-
-#include <stdio.h>
#include <stdarg.h>
+typedef __typeof(sizeof(int)) size_t;
+typedef struct _FILE FILE;
+int fprintf(FILE *, const char *restrict, ...);
+int printf(const char *restrict, ...);
+int snprintf(char *restrict, size_t, const char *restrict, ...);
+int sprintf(char *restrict, const char *restrict, ...);
+int vasprintf(char **, const char *, va_list);
+int vfprintf(FILE *, const char *restrict, va_list);
+int vprintf(const char *restrict, va_list);
+int vsnprintf(char *, size_t, const char *, va_list);
+int vsprintf(char *restrict, const char *restrict, va_list);
char * global_fmt;
-#if defined(_WIN32) || defined(_WIN64)
-extern int snprintf(char*, size_t, const char*, ...);
-#endif
-
void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
char * b;
diff --git a/clang/test/Sema/ucn-cstring.c b/clang/test/Sema/ucn-cstring.c
index 6d021fd82d1..fb9a3b604eb 100644
--- a/clang/test/Sema/ucn-cstring.c
+++ b/clang/test/Sema/ucn-cstring.c
@@ -1,6 +1,6 @@
// RUN: clang-cc %s -verify -fsyntax-only -pedantic
-#include <stdio.h>
+int printf(const char *, ...);
int main(void) {
int a[sizeof("hello \u2192 \u2603 \u2190 world") == 24 ? 1 : -1];
diff --git a/clang/test/SemaObjC/unused.m b/clang/test/SemaObjC/unused.m
index bbe3109a281..4e85894b0a1 100644
--- a/clang/test/SemaObjC/unused.m
+++ b/clang/test/SemaObjC/unused.m
@@ -1,5 +1,6 @@
// RUN: clang-cc %s -verify -Wunused -fsyntax-only
-#include <stdio.h>
+
+int printf(const char *, ...);
@interface Greeter
+ (void) hello;
@@ -7,7 +8,7 @@
@implementation Greeter
+ (void) hello {
- fprintf(stdout, "Hello, World!\n");
+ printf("Hello, World!\n");
}
@end
OpenPOWER on IntegriCloud