diff options
author | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
commit | 1eb4433ac451dc16f4133a88af2d002ac26c58ef (patch) | |
tree | 07065b80cb7787bb7b9ffcb985196007a57e86f7 /test | |
parent | 79d39f92590cf2e91bf81486b02cd1156d13ca54 (diff) |
Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
70 files changed, 518 insertions, 565 deletions
diff --git a/test/Analysis/cfref_rdar6080742.c b/test/Analysis/cfref_rdar6080742.c index 5d957615d0..9bbaf9b5ae 100644 --- a/test/Analysis/cfref_rdar6080742.c +++ b/test/Analysis/cfref_rdar6080742.c @@ -44,15 +44,15 @@ Boolean DebugDisplayOSStatusMsg(OSStatus status, const char *statusStr, #define AssertNoErr(err){ DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__); } #define RequireNoErr(err, action){ if( DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__) ) { action }} -void DebugStop(const char *format,...); /* Not an abort function. */ +void DebugStop(const char *format,...); /* Not an abort function. */ int main(int argc, char *argv[]) { - CFStringRef cfString; - OSStatus status = noErr; - cfString = CFStringCreateWithCString(0, "hello", kCFStringEncodingUTF8); - RequireAction(cfString != 0, return memFullErr;) //no - warning - printf("cfstring %p\n", cfString); -Exit: - CFRelease(cfString); - return 0; + CFStringRef cfString; + OSStatus status = noErr; + cfString = CFStringCreateWithCString(0, "hello", kCFStringEncodingUTF8); + RequireAction(cfString != 0, return memFullErr;) //no - warning + printf("cfstring %p\n", cfString); + Exit: + CFRelease(cfString); + return 0; } diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index f400e9347a..46563213b1 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -15,7 +15,7 @@ void t4() { unsigned long long a; struct reg { unsigned long long a, b; } b; - __asm__ volatile ("":: "m"(a), "m"(b)); + __asm__ volatile ("":: "m"(a), "m"(b)); } // PR3417 diff --git a/test/CodeGen/attr-cleanup.c b/test/CodeGen/attr-cleanup.c index 03dde3341e..9105ededa2 100644 --- a/test/CodeGen/attr-cleanup.c +++ b/test/CodeGen/attr-cleanup.c @@ -3,6 +3,6 @@ // <rdar://problem/6827047> void f(void* arg); void g() { - __attribute__((cleanup(f))) void *g; + __attribute__((cleanup(f))) void *g; } diff --git a/test/CodeGen/conditional.c b/test/CodeGen/conditional.c index 22286705c8..8a30463cb7 100644 --- a/test/CodeGen/conditional.c +++ b/test/CodeGen/conditional.c @@ -1,11 +1,10 @@ // RUN: clang-cc -emit-llvm %s -o %t -float test1(int cond, float a, float b) -{ +float test1(int cond, float a, float b) { return cond ? a : b; } -double test2(int cond, float a, double b) -{ + +double test2(int cond, float a, double b) { return cond ? a : b; } @@ -16,8 +15,8 @@ void test3(){ } void test4() { -int i; short j; -float* k = 1 ? &i : &j; + int i; short j; + float* k = 1 ? &i : &j; } void test5() { @@ -33,12 +32,10 @@ void* test8() {return 1 ? test6 : test7;} void _efree(void *ptr); -void _php_stream_free3() -{ - (1 ? free(0) : _efree(0)); +void _php_stream_free3() { + (1 ? free(0) : _efree(0)); } -void _php_stream_free4() -{ - 1 ? _efree(0) : free(0); +void _php_stream_free4() { + 1 ? _efree(0) : free(0); } diff --git a/test/CodeGen/debug-info.c b/test/CodeGen/debug-info.c index e0ec2c9027..beee7ac9b6 100644 --- a/test/CodeGen/debug-info.c +++ b/test/CodeGen/debug-info.c @@ -24,14 +24,14 @@ char xpto[]; // PR3427 struct foo { - int a; - void *ptrs[]; + int a; + void *ptrs[]; }; struct foo bar; // PR4143 struct foo2 { - enum bar *bar; + enum bar *bar; }; struct foo2 foo2; diff --git a/test/CodeGen/exprs.c b/test/CodeGen/exprs.c index 599e541d94..a0e5b7644a 100644 --- a/test/CodeGen/exprs.c +++ b/test/CodeGen/exprs.c @@ -48,9 +48,9 @@ int ola() { // this one shouldn't fold as well void eMaisUma() { - double t[1]; - if (*t) - return; + double t[1]; + if (*t) + return; } // rdar://6520707 diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c index 685afb2225..dba29316e1 100644 --- a/test/CodeGen/functions.c +++ b/test/CodeGen/functions.c @@ -3,11 +3,11 @@ int g(); int foo(int i) { - return g(i); + return g(i); } int g(int i) { - return g(i); + return g(i); } // rdar://6110827 diff --git a/test/CodeGen/global-with-initialiser.c b/test/CodeGen/global-with-initialiser.c index 29b4e21b91..d253782f66 100644 --- a/test/CodeGen/global-with-initialiser.c +++ b/test/CodeGen/global-with-initialiser.c @@ -17,9 +17,9 @@ long double globalLongDouble = 1; long double globalLongDoubleArray[5] = { 1.0, 2.0 }; struct Struct { - int member1; - float member2; - char *member3; + int member1; + float member2; + char *member3; }; struct Struct globalStruct = { 1, 2.0f, "foobar"}; diff --git a/test/CodeGen/globalinit.c b/test/CodeGen/globalinit.c index 2798cae712..b3d0cb54d1 100644 --- a/test/CodeGen/globalinit.c +++ b/test/CodeGen/globalinit.c @@ -37,7 +37,7 @@ static int a = { 1 }; // References to enums. enum { - EnumA, EnumB + EnumA, EnumB }; int c[] = { EnumA, EnumB }; diff --git a/test/CodeGen/init-with-member-expr.c b/test/CodeGen/init-with-member-expr.c index 7750dbf986..197a9ab4e3 100644 --- a/test/CodeGen/init-with-member-expr.c +++ b/test/CodeGen/init-with-member-expr.c @@ -14,7 +14,7 @@ typedef struct mark_header_tag { } mark_header_t; int is_rar_archive(int fd) { const mark_header_t rar_hdr[2] = {{0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}, {'U', 'n', 'i', 'q', 'u', 'E', '!'}}; - foo(rar_hdr); + foo(rar_hdr); return 0; } diff --git a/test/CodeGen/regparm.c b/test/CodeGen/regparm.c index fdf07ead6d..28dfae7f62 100644 --- a/test/CodeGen/regparm.c +++ b/test/CodeGen/regparm.c @@ -9,11 +9,10 @@ typedef struct { } foo; static void FASTCALL -reduced(char b, double c, foo* d, double e, int f) -{ +reduced(char b, double c, foo* d, double e, int f) { } int main(void) { - reduced(0, 0.0, 0, 0.0, 0); + reduced(0, 0.0, 0, 0.0, 0); } diff --git a/test/CodeGen/staticinit.c b/test/CodeGen/staticinit.c index 91fcdcf69f..c68366f2ea 100644 --- a/test/CodeGen/staticinit.c +++ b/test/CodeGen/staticinit.c @@ -2,9 +2,9 @@ // RUN: grep "g.b = internal global i8. getelementptr" %t && struct AStruct { - int i; - char *s; - double d; + int i; + char *s; + double d; }; void f() { diff --git a/test/CodeGen/struct-init.c b/test/CodeGen/struct-init.c index a38442b1a8..cb84fef4d1 100644 --- a/test/CodeGen/struct-init.c +++ b/test/CodeGen/struct-init.c @@ -2,11 +2,11 @@ typedef struct _zend_ini_entry zend_ini_entry; struct _zend_ini_entry { - void *mh_arg1; + void *mh_arg1; }; char a; const zend_ini_entry ini_entries[] = { - { ((char*)&((zend_ini_entry*)0)->mh_arg1 - (char*)(void*)0)}, + { ((char*)&((zend_ini_entry*)0)->mh_arg1 - (char*)(void*)0)}, }; diff --git a/test/CodeGen/struct.c b/test/CodeGen/struct.c index ed3684280e..d1e58a2445 100644 --- a/test/CodeGen/struct.c +++ b/test/CodeGen/struct.c @@ -70,8 +70,7 @@ typedef struct { int length; } range; extern range f6(); -void f7() -{ +void f7() { range r = f6(); } @@ -81,27 +80,23 @@ typedef struct { range range2; } rangepair; -void f8() -{ +void f8() { rangepair p; range r = p.range1; } -void f9(range *p) -{ +void f9(range *p) { range r = *p; } -void f10(range *p) -{ +void f10(range *p) { range r = p[0]; } /* _Bool types */ -struct _w -{ +struct _w { short a,b; short c,d; short e,f; @@ -113,27 +108,24 @@ struct _w } ws; /* Implicit casts (due to typedefs) */ -typedef struct _a -{ +typedef struct _a { int a; } a; -void f11() -{ - struct _a a1; - a a2; +void f11() { + struct _a a1; + a a2; - a1 = a2; - a2 = a1; + a1 = a2; + a2 = a1; } /* Implicit casts (due to const) */ -void f12() -{ - struct _a a1; - const struct _a a2; - - a1 = a2; +void f12() { + struct _a a1; + const struct _a a2; + + a1 = a2; } /* struct initialization */ @@ -147,8 +139,7 @@ struct a15 {char a; int b[];} c15; int a16(void) {c15.a = 1;} /* compound literals */ -void f13() -{ +void f13() { a13 x; x = (a13){1,2}; } diff --git a/test/CodeGen/union-init.c b/test/CodeGen/union-init.c index c882d3180c..f4e9e9a08f 100644 --- a/test/CodeGen/union-init.c +++ b/test/CodeGen/union-init.c @@ -4,19 +4,19 @@ typedef int Py_ssize_t; typedef union _gc_head { - struct { - union _gc_head *gc_next; - union _gc_head *gc_prev; - Py_ssize_t gc_refs; - } gc; - long double dummy; /* force worst-case alignment */ + struct { + union _gc_head *gc_next; + union _gc_head *gc_prev; + Py_ssize_t gc_refs; + } gc; + long double dummy; /* force worst-case alignment */ } PyGC_Head; struct gc_generation { - PyGC_Head head; - int threshold; /* collection threshold */ - int count; /* count of allocations or collections of younger - generations */ + PyGC_Head head; + int threshold; /* collection threshold */ + int count; /* count of allocations or collections of younger + generations */ }; #define NUM_GENERATIONS 3 @@ -24,8 +24,8 @@ struct gc_generation { /* linked lists of container objects */ struct gc_generation generations[NUM_GENERATIONS] = { - /* PyGC_Head, threshold, count */ - {{{GEN_HEAD(0), GEN_HEAD(0), 0}}, 700, 0}, - {{{GEN_HEAD(1), GEN_HEAD(1), 0}}, 10, 0}, - {{{GEN_HEAD(2), GEN_HEAD(2), 0}}, 10, 0}, + /* PyGC_Head, threshold, count */ + {{{GEN_HEAD(0), GEN_HEAD(0), 0}}, 700, 0}, + {{{GEN_HEAD(1), GEN_HEAD(1), 0}}, 10, 0}, + {{{GEN_HEAD(2), GEN_HEAD(2), 0}}, 10, 0}, }; diff --git a/test/CodeGen/vector.c b/test/CodeGen/vector.c index 1084f6d20b..5e48fd42b1 100644 --- a/test/CodeGen/vector.c +++ b/test/CodeGen/vector.c @@ -1,9 +1,8 @@ // RUN: clang-cc -emit-llvm %s -o - typedef short __v4hi __attribute__ ((__vector_size__ (8))); -void f() -{ - __v4hi A = (__v4hi)0LL; +void f() { + __v4hi A = (__v4hi)0LL; } __v4hi x = {1,2,3}; @@ -15,7 +14,6 @@ int a() { vty b; return b[2LL]; } // PR4339 typedef float vec4 __attribute__((vector_size(16))); -void vac ( vec4* a, char b, float c ) -{ - (*a)[b] = c; +void vac ( vec4* a, char b, float c ) { + (*a)[b] = c; } diff --git a/test/CodeGenCXX/constructor-conversion.cpp b/test/CodeGenCXX/constructor-conversion.cpp index 3fafe61769..980b230118 100644 --- a/test/CodeGenCXX/constructor-conversion.cpp +++ b/test/CodeGenCXX/constructor-conversion.cpp @@ -8,16 +8,16 @@ extern "C" int printf(...); class X { // ... public: - X(int) : iX(2), fX(2.3) , name("HELLO\n") { } - - X(const char* arg, int ix=0) { iX = ix; fX = 6.0; name = arg+ix; } - X(): iX(100), fX(1.2) {} - int iX; - float fX; - const char *name; - void pr(void) { - printf("iX = %d fX = %f name = %s\n", iX, fX, name); - } + X(int) : iX(2), fX(2.3) , name("HELLO\n") { } + + X(const char* arg, int ix=0) { iX = ix; fX = 6.0; name = arg+ix; } + X(): iX(100), fX(1.2) {} + int iX; + float fX; + const char *name; + void pr(void) { + printf("iX = %d fX = %f name = %s\n", iX, fX, name); + } }; void g(X arg) { @@ -25,8 +25,7 @@ void g(X arg) { } void f(X arg) { - - X a = 1; // a = X(1) + X a = 1; // a = X(1) a.pr(); @@ -35,18 +34,16 @@ void f(X arg) { b.pr(); - a = 2; // a = X(2) + a = 2; // a = X(2) a.pr(); - } -int main() -{ - X x; - f(x); - g(3); // g(X(3)) +int main() { + X x; + f(x); + g(3); // g(X(3)) } // CHECK-LP64: call __ZN1XC1Ei diff --git a/test/CodeGenCXX/constructor-default-arg.cpp b/test/CodeGenCXX/constructor-default-arg.cpp index fe5b360d0b..6691912b6f 100644 --- a/test/CodeGenCXX/constructor-default-arg.cpp +++ b/test/CodeGenCXX/constructor-default-arg.cpp @@ -8,8 +8,8 @@ extern "C" int printf(...); struct C { - C() : iC(6) {} - int iC; + C() : iC(6) {} + int iC; }; int foo() { @@ -18,23 +18,23 @@ int foo() { class X { // ... public: - X(int) {} - X(const X&, int i = 1, int j = 2, int k = foo()) { - printf("X(const X&, %d, %d, %d)\n", i, j, k); - } + X(int) {} + X(const X&, int i = 1, int j = 2, int k = foo()) { + printf("X(const X&, %d, %d, %d)\n", i, j, k); + } }; -int main() -{ - X a(1); - X b(a, 2); - X c = b; - X d(a, 5, 6); +int main() { + X a(1); + X b(a, 2); + X c = b; + X d(a, 5, 6); } -// CHECK-LP64: call __ZN1XC1ERK1Xiii -// CHECK-LP64: call __ZN1XC1ERK1Xiii -// CHECK-LP64: call __ZN1XC1ERK1Xiii -// CHECK-LP32: call L__ZN1XC1ERK1Xiii -// CHECK-LP32: call L__ZN1XC1ERK1Xiii -// CHECK-LP32: call L__ZN1XC1ERK1Xiii +// CHECK-LP64: call __ZN1XC1ERK1Xiii +// CHECK-LP64: call __ZN1XC1ERK1Xiii +// CHECK-LP64: call __ZN1XC1ERK1Xiii + +// CHECK-LP32: call L__ZN1XC1ERK1Xiii +// CHECK-LP32: call L__ZN1XC1ERK1Xiii +// CHECK-LP32: call L__ZN1XC1ERK1Xiii diff --git a/test/CodeGenCXX/constructor-for-array-members.cpp b/test/CodeGenCXX/constructor-for-array-members.cpp index 9d9e2c8290..fbb13e0aa3 100644 --- a/test/CodeGenCXX/constructor-for-array-members.cpp +++ b/test/CodeGenCXX/constructor-for-array-members.cpp @@ -35,11 +35,10 @@ struct M { }; int main() { - M m1; - m1.pr(); - + M m1; + m1.pr(); } -// CHECK-LP64: |