// 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;
// 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");
// 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;
// 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);
// 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));
#define I 1.0iF
-#include <stdio.h>
+int putchar(char c);
volatile double __complex__ accum;
// 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__);
} a, b;
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
-#include <stdio.h>
+int printf(const char *, ...);
int main() {
// A use.
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
@end
// RUN: clang-cc --emit-llvm -o %t %s
-#include <stdio.h>
+int printf(const char *, ...);
@interface Root
-(id) alloc;
// RUN: clang-cc -fsyntax-only -verify < %s
-%:include <stdio.h>
+%:include <stdint.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512
// 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() {
-// 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>
// 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.
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
const char* f(const char *s) __attribute__((format_arg(1)));
// 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);
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-#include <stdio.h>
+int printf(const char *, ...);
void _Block_byref_release(void*src){}
int main() {
// RUN: clang-cc -fsyntax-only -verify %s
-#include <stdio.h>
+int printf(const char *, ...);
typedef int *pint;
int main() {
int a[5] = {0};
// 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)));
// 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;
// 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];
// RUN: clang-cc %s -verify -Wunused -fsyntax-only
-#include <stdio.h>
+
+int printf(const char *, ...);
@interface Greeter
+ (void) hello;
@implementation Greeter
+ (void) hello {
- fprintf(stdout, "Hello, World!\n");
+ printf("Hello, World!\n");
}
@end