]> granicus.if.org Git - clang/commitdiff
Don't #include <stdio.h> when tests don't need it, or use clang instead of clang...
authorDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 08:57:36 +0000 (08:57 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 08:57:36 +0000 (08:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89070 91177308-0d34-0410-b5e6-96231b3b80d8

24 files changed:
test/Analysis/ObjCRetSigs.m
test/CodeGen/PR3589-freestanding-libcalls.c
test/CodeGen/blocks-1.c
test/CodeGen/builtins.c
test/CodeGen/constructor-attribute.c
test/CodeGen/mandel.c
test/CodeGen/predefined-expr.c
test/CodeGen/volatile-1.c
test/CodeGenObjC/dot-syntax-1.m
test/CodeGenObjC/dot-syntax.m
test/CodeGenObjC/messages-2.m
test/CodeGenObjC/property.m
test/Lexer/digraph.c
test/Parser/block-block-storageclass.c
test/Preprocessor/header_lookup1.c
test/Preprocessor/objc-pp.m
test/Sema/attr-format_arg.c
test/Sema/block-byref-args.c
test/Sema/block-storageclass.c
test/Sema/check-increment.c
test/Sema/format-attr-pr4470.c
test/Sema/format-strings.c
test/Sema/ucn-cstring.c
test/SemaObjC/unused.m

index 3ee13e0e63e4f0de32be4c794fdeb7714ae05eca..60a85fd791ed8998a3ee3e86d49a51fbecae70ab 100644 (file)
@@ -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;
index b2d22753791f4b94386e46145774bcf7dea35257..14608137188e9b835ce66d6540ae4aef0f0e01d7 100644 (file)
@@ -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");
index 5b639d10beb8784ef1d22943a77f0fd871fa97ef..ae5a74aab6f0ac6b4cfe10f8b6ece493aeb44e1a 100644 (file)
@@ -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;
index b4db48ae4b2c4b07fe5c19ec875f60e8a4f1978c..11bcc14249aceb95857bc4543013f0e800ae4574 100644 (file)
@@ -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);
index 69e7063eab25125457d14e3c6d003d7438fd0aa5..b715201dc53bd87a393e1b2a8c446b6faef26319 100644 (file)
@@ -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));
index 27993f0559e9951fb0176a1dc12bad2118db74ec..9d7956c56d1b89229773dc09cd4d202c99256156 100644 (file)
@@ -25,7 +25,7 @@ int main() { return 0; }
 
 #define I 1.0iF
 
-#include <stdio.h>
+int putchar(char c);
 
 volatile double __complex__ accum;
 
index 9b645931a4a7c052b5ced2ed390ea315954f2700..1a5dcb4fc6ff940c9c1b0de6c8ba8ed1082ea978 100644 (file)
@@ -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__);
index 9df11d249da92499b473766568680ebea5a08df6..3203326ecebf8fb619174ca9601e8860c3708548 100644 (file)
@@ -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.
index 491ea0a5a6388589b5a67357be3d9869936d0129..6fab03935beaae6281d7ac0e73d3c13d0e346148 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc --emit-llvm -o %t %s
 
-#include <stdio.h>
+int printf(const char *, ...);
 
 @interface Root
 -(id) alloc;
index bd61a6aaf9576a02cdc7eabeb7c757c2074dab63..348346b8fca2e76a65351f15239905bacd9be356 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc --emit-llvm -o %t %s
 
-#include <stdio.h>
+int printf(const char *, ...);
 
 @interface Root
 -(id) alloc;
index 02dbd01df8f1d30d3528a185a3a3bee70cb06eae..5cf4d2df221373f902fa5e40655e9c7dfdc4f126 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc --emit-llvm -o %t %s
 
-#include <stdio.h>
+int printf(const char *, ...);
 
 @interface Root
 @end
index 8ac44f1c794f92a7efcee479f634ee90f91c17d9..59f096f5c5904d833a9cb0aaf75eba18c9d07be9 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc --emit-llvm -o %t %s
 
-#include <stdio.h>
+int printf(const char *, ...);
 
 @interface Root
 -(id) alloc;
index 4d494ca1dd9429c436e919c1d4fb3edc6514db4e..3c92db1c02b2a5c58a9966f24f7b7a2dbc9968c3 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc -fsyntax-only -verify < %s
 
-%:include <stdio.h>
+%:include <stdint.h>
 
     %:ifndef BUFSIZE
      %:define BUFSIZE  512
index d24ec5f1c69889f28840d51a37af80e7dc565ecf..df9423460cd5a51183dd59d42be560475e87b6fd 100644 (file)
@@ -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() {
index df58a6ea9c542060eac958e54fa7739cfb678c8b..10049adcd374b0bd1557d3c37a6f82fc1b93e16c 100644 (file)
@@ -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>
index 4ab2f07cef26c6a90b03738d626e04fc4a670636..977789e38f1cd36f95233af3d35810cc7ab30086 100644 (file)
@@ -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.
 
index 0830951acc8927595fbecb78ca6ccd88479d0ac3..5f06f4ba3fc9d510e07b2b6462d2b6616f191a3f 100644 (file)
@@ -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)));
 
index 39745d54efa4c19a53d55320b24ed1b74f9e9c2d..06bab121f9177c6d5f73ce4fb19562432a7ab14a 100644 (file)
@@ -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);
index 3d2527b3f4e8ae8dba0c894de1f6ae4425b79036..aacf8be2c06dda1c74fc7df549982d9c94d5811f 100644 (file)
@@ -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() {
index 9809544854d860b6d9b4c98d35aac453d3f41911..72eae06bfa1be485e26fb9d8d3a5006039192f0e 100644 (file)
@@ -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};
index c03c573b7274448962620500d1df6f93fc89a578..24eece8878e22872816c9f49f7ee3d17a4410931 100644 (file)
@@ -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)));
 
index 797e53c1bd22cdf59ade5429a7add295d6865402..0a9fccebd7fdff909ddca795ff4c5019adb1059b 100644 (file)
@@ -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;
index 6d021fd82d16079181e46eda0de987933dea25c0..fb9a3b604eb743bc9f25b29880ee18e90913ce2d 100644 (file)
@@ -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];
index bbe3109a28173d617fe6f0906c53c9f52ee4aebd..4e85894b0a1b9a8518598ab96a5dd01885e7fcea 100644 (file)
@@ -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