Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.

llvm-svn: 89070
This commit is contained in:
Daniel Dunbar 2009-11-17 08:57:36 +00:00
parent f85fabec35
commit feedba68b5
24 changed files with 36 additions and 32 deletions

View 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;

View 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");

View 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;

View 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);

View 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));

View File

@ -25,7 +25,7 @@ int main() { return 0; }
#define I 1.0iF
#include <stdio.h>
int putchar(char c);
volatile double __complex__ accum;

View 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__);

View 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.

View File

@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
int printf(const char *, ...);
@interface Root
-(id) alloc;

View File

@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
int printf(const char *, ...);
@interface Root
-(id) alloc;

View File

@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
int printf(const char *, ...);
@interface Root
@end

View File

@ -1,6 +1,6 @@
// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
int printf(const char *, ...);
@interface Root
-(id) alloc;

View File

@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify < %s
%:include <stdio.h>
%:include <stdint.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512

View 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() {

View 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>

View 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.

View 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)));

View 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);

View 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() {

View 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};

View 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)));

View 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;

View 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];

View 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