[cfe-commits] r89070 - in /cfe/trunk/test: Analysis/ CodeGen/ CodeGenObjC/ Lexer/ Parser/ Preprocessor/ Sema/ SemaObjC/
Daniel Dunbar
daniel at zuster.org
Tue Nov 17 00:57:37 PST 2009
Author: ddunbar
Date: Tue Nov 17 02:57:36 2009
New Revision: 89070
URL: http://llvm.org/viewvc/llvm-project?rev=89070&view=rev
Log:
Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.
Modified:
cfe/trunk/test/Analysis/ObjCRetSigs.m
cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c
cfe/trunk/test/CodeGen/blocks-1.c
cfe/trunk/test/CodeGen/builtins.c
cfe/trunk/test/CodeGen/constructor-attribute.c
cfe/trunk/test/CodeGen/mandel.c
cfe/trunk/test/CodeGen/predefined-expr.c
cfe/trunk/test/CodeGen/volatile-1.c
cfe/trunk/test/CodeGenObjC/dot-syntax-1.m
cfe/trunk/test/CodeGenObjC/dot-syntax.m
cfe/trunk/test/CodeGenObjC/messages-2.m
cfe/trunk/test/CodeGenObjC/property.m
cfe/trunk/test/Lexer/digraph.c
cfe/trunk/test/Parser/block-block-storageclass.c
cfe/trunk/test/Preprocessor/header_lookup1.c
cfe/trunk/test/Preprocessor/objc-pp.m
cfe/trunk/test/Sema/attr-format_arg.c
cfe/trunk/test/Sema/block-byref-args.c
cfe/trunk/test/Sema/block-storageclass.c
cfe/trunk/test/Sema/check-increment.c
cfe/trunk/test/Sema/format-attr-pr4470.c
cfe/trunk/test/Sema/format-strings.c
cfe/trunk/test/Sema/ucn-cstring.c
cfe/trunk/test/SemaObjC/unused.m
Modified: cfe/trunk/test/Analysis/ObjCRetSigs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ObjCRetSigs.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/ObjCRetSigs.m (original)
+++ cfe/trunk/test/Analysis/ObjCRetSigs.m Tue Nov 17 02:57:36 2009
@@ -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;
Modified: cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c (original)
+++ cfe/trunk/test/CodeGen/PR3589-freestanding-libcalls.c Tue Nov 17 02:57:36 2009
@@ -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");
Modified: cfe/trunk/test/CodeGen/blocks-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-1.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks-1.c (original)
+++ cfe/trunk/test/CodeGen/blocks-1.c Tue Nov 17 02:57:36 2009
@@ -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;
Modified: cfe/trunk/test/CodeGen/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins.c (original)
+++ cfe/trunk/test/CodeGen/builtins.c Tue Nov 17 02:57:36 2009
@@ -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);
Modified: cfe/trunk/test/CodeGen/constructor-attribute.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/constructor-attribute.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/constructor-attribute.c (original)
+++ cfe/trunk/test/CodeGen/constructor-attribute.c Tue Nov 17 02:57:36 2009
@@ -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));
Modified: cfe/trunk/test/CodeGen/mandel.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mandel.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mandel.c (original)
+++ cfe/trunk/test/CodeGen/mandel.c Tue Nov 17 02:57:36 2009
@@ -25,7 +25,7 @@
#define I 1.0iF
-#include <stdio.h>
+int putchar(char c);
volatile double __complex__ accum;
Modified: cfe/trunk/test/CodeGen/predefined-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/predefined-expr.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/predefined-expr.c (original)
+++ cfe/trunk/test/CodeGen/predefined-expr.c Tue Nov 17 02:57:36 2009
@@ -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__);
Modified: cfe/trunk/test/CodeGen/volatile-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/volatile-1.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/volatile-1.c (original)
+++ cfe/trunk/test/CodeGen/volatile-1.c Tue Nov 17 02:57:36 2009
@@ -14,7 +14,7 @@
} a, b;
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
-#include <stdio.h>
+int printf(const char *, ...);
int main() {
// A use.
Modified: cfe/trunk/test/CodeGenObjC/dot-syntax-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/dot-syntax-1.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/dot-syntax-1.m (original)
+++ cfe/trunk/test/CodeGenObjC/dot-syntax-1.m Tue Nov 17 02:57:36 2009
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
Modified: cfe/trunk/test/CodeGenObjC/dot-syntax.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/dot-syntax.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/dot-syntax.m (original)
+++ cfe/trunk/test/CodeGenObjC/dot-syntax.m Tue Nov 17 02:57:36 2009
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
Modified: cfe/trunk/test/CodeGenObjC/messages-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/messages-2.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/messages-2.m (original)
+++ cfe/trunk/test/CodeGenObjC/messages-2.m Tue Nov 17 02:57:36 2009
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
@end
Modified: cfe/trunk/test/CodeGenObjC/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property.m (original)
+++ cfe/trunk/test/CodeGenObjC/property.m Tue Nov 17 02:57:36 2009
@@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
Modified: cfe/trunk/test/Lexer/digraph.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/digraph.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/digraph.c (original)
+++ cfe/trunk/test/Lexer/digraph.c Tue Nov 17 02:57:36 2009
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify < %s
-%:include <stdio.h>
+%:include <stdint.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512
Modified: cfe/trunk/test/Parser/block-block-storageclass.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/block-block-storageclass.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Parser/block-block-storageclass.c (original)
+++ cfe/trunk/test/Parser/block-block-storageclass.c Tue Nov 17 02:57:36 2009
@@ -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() {
Modified: cfe/trunk/test/Preprocessor/header_lookup1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/header_lookup1.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/header_lookup1.c (original)
+++ cfe/trunk/test/Preprocessor/header_lookup1.c Tue Nov 17 02:57:36 2009
@@ -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>
Modified: cfe/trunk/test/Preprocessor/objc-pp.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/objc-pp.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/objc-pp.m (original)
+++ cfe/trunk/test/Preprocessor/objc-pp.m Tue Nov 17 02:57:36 2009
@@ -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.
Modified: cfe/trunk/test/Sema/attr-format_arg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-format_arg.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-format_arg.c (original)
+++ cfe/trunk/test/Sema/attr-format_arg.c Tue Nov 17 02:57:36 2009
@@ -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)));
Modified: cfe/trunk/test/Sema/block-byref-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-byref-args.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-byref-args.c (original)
+++ cfe/trunk/test/Sema/block-byref-args.c Tue Nov 17 02:57:36 2009
@@ -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);
Modified: cfe/trunk/test/Sema/block-storageclass.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-storageclass.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-storageclass.c (original)
+++ cfe/trunk/test/Sema/block-storageclass.c Tue Nov 17 02:57:36 2009
@@ -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() {
Modified: cfe/trunk/test/Sema/check-increment.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/check-increment.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/check-increment.c (original)
+++ cfe/trunk/test/Sema/check-increment.c Tue Nov 17 02:57:36 2009
@@ -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};
Modified: cfe/trunk/test/Sema/format-attr-pr4470.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-attr-pr4470.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-attr-pr4470.c (original)
+++ cfe/trunk/test/Sema/format-attr-pr4470.c Tue Nov 17 02:57:36 2009
@@ -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)));
Modified: cfe/trunk/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings.c (original)
+++ cfe/trunk/test/Sema/format-strings.c Tue Nov 17 02:57:36 2009
@@ -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;
Modified: cfe/trunk/test/Sema/ucn-cstring.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ucn-cstring.c?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/Sema/ucn-cstring.c (original)
+++ cfe/trunk/test/Sema/ucn-cstring.c Tue Nov 17 02:57:36 2009
@@ -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];
Modified: cfe/trunk/test/SemaObjC/unused.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/unused.m?rev=89070&r1=89069&r2=89070&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/unused.m (original)
+++ cfe/trunk/test/SemaObjC/unused.m Tue Nov 17 02:57:36 2009
@@ -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
More information about the cfe-commits
mailing list