aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-09-09 15:08:12 +0000
committerMike Stump <mrs@apple.com>2009-09-09 15:08:12 +0000
commit1eb4433ac451dc16f4133a88af2d002ac26c58ef (patch)
tree07065b80cb7787bb7b9ffcb985196007a57e86f7 /test
parent79d39f92590cf2e91bf81486b02cd1156d13ca54 (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')
-rw-r--r--test/Analysis/cfref_rdar6080742.c18
-rw-r--r--test/CodeGen/asm.c2
-rw-r--r--test/CodeGen/attr-cleanup.c2
-rw-r--r--test/CodeGen/conditional.c21
-rw-r--r--test/CodeGen/debug-info.c6
-rw-r--r--test/CodeGen/exprs.c6
-rw-r--r--test/CodeGen/functions.c4
-rw-r--r--test/CodeGen/global-with-initialiser.c6
-rw-r--r--test/CodeGen/globalinit.c2
-rw-r--r--test/CodeGen/init-with-member-expr.c2
-rw-r--r--test/CodeGen/regparm.c5
-rw-r--r--test/CodeGen/staticinit.c6
-rw-r--r--test/CodeGen/struct-init.c4
-rw-r--r--test/CodeGen/struct.c43
-rw-r--r--test/CodeGen/union-init.c28
-rw-r--r--test/CodeGen/vector.c10
-rw-r--r--test/CodeGenCXX/constructor-conversion.cpp35
-rw-r--r--test/CodeGenCXX/constructor-default-arg.cpp36
-rw-r--r--test/CodeGenCXX/constructor-for-array-members.cpp9
-rw-r--r--test/CodeGenCXX/constructor-init.cpp27
-rw-r--r--test/CodeGenCXX/constructor-template.cpp4
-rw-r--r--test/CodeGenCXX/conversion-function.cpp80
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis-1.cpp14
-rw-r--r--test/CodeGenCXX/copy-constructor-elim.cpp29
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis.cpp79
-rw-r--r--test/CodeGenCXX/default-constructor-for-members.cpp4
-rw-r--r--test/CodeGenCXX/default-destructor-synthesis.cpp24
-rw-r--r--test/CodeGenCXX/nested-base-member-access.cpp17
-rw-r--r--test/CodeGenCXX/virt.cpp2
-rw-r--r--test/Lexer/comment-escape.c2
-rw-r--r--test/Parser/MicrosoftExtensions.c16
-rw-r--r--test/Parser/cxx-friend.cpp2
-rw-r--r--test/Parser/cxx-template-decl.cpp2
-rw-r--r--test/Preprocessor/assembler-with-cpp.c2
-rw-r--r--test/Sema/array-init.c17
-rw-r--r--test/Sema/attr-deprecated.c2
-rw-r--r--test/Sema/block-call.c52
-rw-r--r--test/Sema/block-explicit-return-type.c66
-rw-r--r--test/Sema/block-literal.c42
-rw-r--r--test/Sema/block-misc.c24
-rw-r--r--test/Sema/block-printf-attribute-1.c17
-rw-r--r--test/Sema/block-return.c4
-rw-r--r--test/Sema/block-sentinel-attribute.c25
-rw-r--r--test/Sema/c89-2.c2
-rw-r--r--test/Sema/c89.c2
-rw-r--r--test/Sema/complex-int.c5
-rw-r--r--test/Sema/conditional.c10
-rw-r--r--test/Sema/darwin-align-cast.c4
-rw-r--r--test/Sema/floating-point-compare.c4
-rw-r--r--test/Sema/function-pointer-sentinel-attribute.c23
-rw-r--r--test/Sema/function-sentinel-attr.c2
-rw-r--r--test/Sema/implicit-int.c6
-rw-r--r--test/Sema/predefined-function.c17
-rw-r--r--test/Sema/static-init.c4
-rw-r--r--test/Sema/struct-decl.c20
-rw-r--r--test/Sema/transparent-union-pointer.c8
-rw-r--r--test/SemaCXX/abstract.cpp57
-rw-r--r--test/SemaCXX/access-control-check.cpp2
-rw-r--r--test/SemaCXX/attr-format.cpp12
-rw-r--r--test/SemaCXX/class-base-member-init.cpp6
-rw-r--r--test/SemaCXX/constructor-initializer.cpp14
-rw-r--r--test/SemaCXX/copy-constructor-error.cpp6
-rw-r--r--test/SemaCXX/default-assignment-operator.cpp16
-rw-r--r--test/SemaCXX/default-constructor-initializers.cpp6
-rw-r--r--test/SemaCXX/enum.cpp11
-rw-r--r--test/SemaCXX/illegal-member-initialization.cpp10
-rw-r--r--test/SemaCXX/inherit.cpp2
-rw-r--r--test/SemaCXX/member-expr-static.cpp18
-rw-r--r--test/SemaCXX/static-initializers.cpp10
-rw-r--r--test/SemaCXX/warn-reorder-ctor-initialization.cpp8
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: call __ZN1SC1Ev
+// CHECK-LP64: call __ZN1SC1Ev
-// CHECK-LP32: call L__ZN1SC1Ev
+// CHECK-LP32: call L__ZN1SC1Ev
diff --git a/test/CodeGenCXX/constructor-init.cpp b/test/CodeGenCXX/constructor-init.cpp
index de86d41552..1b025126a3 100644
--- a/test/CodeGenCXX/constructor-init.cpp
+++ b/test/CodeGenCXX/constructor-init.cpp
@@ -31,19 +31,20 @@ struct N : M , P, Q {
float f1;
int i1;
float d1;
- void PR() { printf("f1 = %f d1 = %f i1 = %d ld = %f \n", f1,d1,i1, ld);
- MPR();
- PPR();
- QPR();
- printf("iQ = %d\n", iQ);
- printf("iP = %d\n", iP);
- printf("iM = %d\n", iM);
- // FIXME. We don't yet support this syntax.
- // printf("iQ = %d\n", (*this).iQ);
- printf("iQ = %d\n", this->iQ);
- printf("iP = %d\n", this->iP);
- printf("iM = %d\n", this->iM);
- }
+ void PR() {
+ printf("f1 = %f d1 = %f i1 = %d ld = %f \n", f1,d1,i1, ld);
+ MPR();
+ PPR();
+ QPR();
+ printf("iQ = %d\n", iQ);
+ printf("iP = %d\n", iP);
+ printf("iM = %d\n", iM);
+ // FIXME. We don't yet support this syntax.
+ // printf("iQ = %d\n", (*this).iQ);
+ printf("iQ = %d\n", this->iQ);
+ printf("iP = %d\n", this->iP);
+ printf("iM = %d\n", this->iM);
+ }
float ld;
float ff;
M arr_m[3];
diff --git a/test/CodeGenCXX/constructor-template.cpp b/test/CodeGenCXX/constructor-template.cpp
index 84e77d43da..8c4f2c9127 100644
--- a/test/CodeGenCXX/constructor-template.cpp
+++ b/test/CodeGenCXX/constructor-template.cpp
@@ -21,7 +21,7 @@ struct B {
// PR4853
template <typename T> class List {
public:
- List(){ } // List<BinomialNode<int>*>::List() remains undefined.
+ List(){ } // List<BinomialNode<int>*>::List() remains undefined.
~List() {}
};
@@ -47,7 +47,7 @@ int main() {
// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED1Ev:
// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED2Ev:
-// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC1Ev:
+// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC1Ev:
// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEEC1Ev:
// CHECK-LP32: __ZN4ListIP12BinomialNodeIiEED1Ev:
diff --git a/test/CodeGenCXX/conversion-function.cpp b/test/CodeGenCXX/conversion-function.cpp
index e7820bb44f..0d21180530 100644
--- a/test/CodeGenCXX/conversion-function.cpp
+++ b/test/CodeGenCXX/conversion-function.cpp
@@ -6,11 +6,11 @@
extern "C" int printf(...);
struct S {
- operator int();
+ operator int();
};
S::operator int() {
- return 10;
+ return 10;
}
@@ -42,51 +42,51 @@ Y y;
int count=0;
class O { // ...
public:
- operator int(){ return ++iO; }
- O() : iO(count++) {}
- int iO;
+ operator int(){ return ++iO; }
+ O() : iO(count++) {}
+ int iO;
};
-void g(O a, O b)
-{
- int i = (a) ? 1+a : 0;
- int j = (a&&b) ? a+b : i;
- if (a) { }
- printf("i = %d j = %d a.iO = %d b.iO = %d\n", i, j, a.iO, b.iO);
+void g(O a, O b) {
+ int i = (a) ? 1+a : 0;
+ int j = (a&&b) ? a+b : i;
+ if (a) { }
+ printf("i = %d j = %d a.iO = %d b.iO = %d\n", i, j, a.iO, b.iO);
}
int main() {
- int c = X(Z(y)); // OK: y.operator Z().operator X().operator int()
- printf("c = %d\n", c);
- float f = X(Z(y));
- printf("f = %f\n", f);
- int i = x;
- printf("i = %d float = %f\n", i, float(x));
- i = int(X(Z(y)));
- f = float(X(Z(y)));
- printf("i = %d float = %f\n", i,f);
- f = (float)x;
- i = (int)x;
- printf("i = %d float = %f\n", i,f);
-
- int d = (X)((Z)y);
- printf("d = %d\n", d);
-
- int e = (int)((X)((Z)y));
- printf("e = %d\n", e);
- O o1, o2;
- g(o1, o2);
+ int c = X(Z(y)); // OK: y.operator Z().operator X().operator int()
+ printf("c = %d\n", c);
+ float f = X(Z(y));
+ printf("f = %f\n", f);
+ int i = x;
+ printf("i = %d float = %f\n", i, float(x));
+ i = int(X(Z(y)));
+ f = float(X(Z(y)));
+ printf("i = %d float = %f\n", i,f);
+ f = (float)x;
+ i = (int)x;
+ printf("i = %d float = %f\n", i,f);
+
+ int d = (X)((Z)y);
+ printf("d = %d\n", d);
+
+ int e = (int)((X)((Z)y));
+ printf("e = %d\n", e);
+ O o1, o2;
+ g(o1, o2);
}
-// CHECK-LP64: .globl __ZN1ScviEv
+
+// CHECK-LP64: .globl __ZN1ScviEv
// CHECK-LP64-NEXT: __ZN1ScviEv:
-// CHECK-LP64: call __ZN1Ycv1ZEv
-// CHECK-LP64: call __ZN1Zcv1XEv
-// CHECK-LP64: call __ZN1XcviEv
-// CHECK-LP64: call __ZN1XcvfEv
+// CHECK-LP64: call __ZN1Ycv1ZEv
+// CHECK-LP64: call __ZN1Zcv1XEv
+// CHECK-LP64: call __ZN1XcviEv
+// CHECK-LP64: call __ZN1XcvfEv
// CHECK-LP32: .globl __ZN1ScviEv
// CHECK-LP32-NEXT: __ZN1ScviEv:
-// CHECK-LP32: call L__ZN1Ycv1ZEv
-// CHECK-LP32: call L__ZN1Zcv1XEv
-// CHECK-LP32: call L__ZN1XcviEv
-// CHECK-LP32: call L__ZN1XcvfEv
+// CHECK-LP32: call L__ZN1Ycv1ZEv
+// CHECK-LP32: call L__ZN1Zcv1XEv
+// CHECK-LP32: call L__ZN1XcviEv
+// CHECK-LP32: call L__ZN1XcvfEv
diff --git a/test/CodeGenCXX/copy-assign-synthesis-1.cpp b/test/CodeGenCXX/copy-assign-synthesis-1.cpp
index c6214409d3..3c24b12752 100644
--- a/test/CodeGenCXX/copy-assign-synthesis-1.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis-1.cpp
@@ -43,14 +43,16 @@ struct N : B {
printf("N1 = %d N2 = %d\n", N1, N2);
for (unsigned i = 0; i < 3; i++)
for (unsigned j = 0; j < 2; j++)
- printf("arr_b[%d][%d] = %f\n", i,j,arr_b[i][j].B1);
+ printf("arr_b[%d][%d] = %f\n", i,j,arr_b[i][j].B1);
B::pr();
}
- N& operator=(const N& arg) { N1 = arg.N1; N2 = arg.N2;
- for (unsigned i = 0; i < 3; i++)
- for (unsigned j = 0; j < 2; j++)
- arr_b[i][j] = arg.arr_b[i][j];
- return *this; }
+ N& operator=(const N& arg) {
+ N1 = arg.N1; N2 = arg.N2;
+ for (unsigned i = 0; i < 3; i++)
+ for (unsigned j = 0; j < 2; j++)
+ arr_b[i][j] = arg.arr_b[i][j];
+ return *this;
+ }
B arr_b[3][2];
};
diff --git a/test/CodeGenCXX/copy-constructor-elim.cpp b/test/CodeGenCXX/copy-constructor-elim.cpp
index 2a6be90bc6..daef92cdb7 100644
--- a/test/CodeGenCXX/copy-constructor-elim.cpp
+++ b/test/CodeGenCXX/copy-constructor-elim.cpp
@@ -7,9 +7,9 @@ extern "C" int printf(...);
struct C {
- C() : iC(6) {printf("C()\n"); }
- C(const C& c) { printf("C(const C& c)\n"); }
- int iC;
+ C() : iC(6) {printf("C()\n"); }
+ C(const C& c) { printf("C(const C& c)\n"); }
+ int iC;
};
C foo() {
@@ -18,10 +18,10 @@ C foo() {
class X { // ...
public:
- X(int) {}
- X(const X&, int i = 1, int j = 2, C c = foo()) {
- printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
- }
+ X(int) {}
+ X(const X&, int i = 1, int j = 2, C c = foo()) {
+ printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
+ }
};
@@ -33,12 +33,11 @@ S::S() { printf("S()\n"); }
void Call(S) {};
-int main()
-{
- X a(1);
- X b(a, 2);
- X c = b;
- X d(a, 5, 6);
- S s;
- Call(s);
+int main() {
+ X a(1);
+ X b(a, 2);
+ X c = b;
+ X d(a, 5, 6);
+ S s;
+ Call(s);
}
diff --git a/test/CodeGenCXX/copy-constructor-synthesis.cpp b/test/CodeGenCXX/copy-constructor-synthesis.cpp
index 2fe196d694..37550c4219 100644
--- a/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -26,35 +26,36 @@ struct P {
struct X : M, N, P { // ...
- X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
- au_i1(1234), au1_4("MASKED") {}
- P p0;
- void pr() { printf("iM = %d iN = %d, m1.iM = %d\n", iM, iN, m1.iM);
- printf("im = %d p0.iP = %d, p1.iP = %d\n", iP, p0.iP, p1.iP);
- printf("f1 = %f d1 = %f i1 = %d name(%s) \n", f1, d1, i1, name);
- printf("bf1 = %x bf2 = %x\n", bf1, bf2);
- printf("au_i2 = %d\n", au_i2);
- printf("au1_1 = %s\n", au1_1);
- }
- M m1;
- P p1;
- float f1;
- double d1;
- int i1;
- const char *name;
- unsigned bf1 : 8;
- unsigned bf2 : 16;
+ X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
+ au_i1(1234), au1_4("MASKED") {}
+ P p0;
+ void pr() {
+ printf("iM = %d iN = %d, m1.iM = %d\n", iM, iN, m1.iM);
+ printf("im = %d p0.iP = %d, p1.iP = %d\n", iP, p0.iP, p1.iP);
+ printf("f1 = %f d1 = %f i1 = %d name(%s) \n", f1, d1, i1, name);
+ printf("bf1 = %x bf2 = %x\n", bf1, bf2);
+ printf("au_i2 = %d\n", au_i2);
+ printf("au1_1 = %s\n", au1_1);
+ }
+ M m1;
+ P p1;
+ float f1;
+ double d1;
+ int i1;
+ const char *name;
+ unsigned bf1 : 8;
+ unsigned bf2 : 16;
- union {
- int au_i1;
- int au_i2;
- };
- union {
- const char * au1_1;
- float au1_2;
- int au1_3;
- const char * au1_4;
- };
+ union {
+ int au_i1;
+ int au_i2;
+ };
+ union {
+ const char * au1_1;
+ float au1_2;
+ int au1_3;
+ const char * au1_4;
+ };
};
static int ix = 1;
@@ -87,19 +88,19 @@ struct XM {
I ARR_I[3][2];
};
-int main()
-{
- X a;
- X b(a);
- b.pr();
- X x;
- X c(x);
- c.pr();
+int main() {
+ X a;
+ X b(a);
+ b.pr();
+ X x;
+ X c(x);
+ c.pr();
- XM m0;
- XM m1 = m0;
- m1.pr();
+ XM m0;
+ XM m1 = m0;
+ m1.pr();
}
+
// CHECK-LP64: .globl __ZN1XC1ERK1X
// CHECK-LP64: .weak_definition __ZN1XC1ERK1X
// CHECK-LP64: __ZN1XC1ERK1X:
diff --git a/test/CodeGenCXX/default-constructor-for-members.cpp b/test/CodeGenCXX/default-constructor-for-members.cpp
index 28938fcebf..2d04bc9414 100644
--- a/test/CodeGenCXX/default-constructor-for-members.cpp
+++ b/test/CodeGenCXX/default-constructor-for-members.cpp
@@ -19,6 +19,6 @@ int main() {
M m1;
}
-// CHECK-LP64: call __ZN1SC1Ev
+// CHECK-LP64: call __ZN1SC1Ev
-// CHECK-LP32: call L__ZN1SC1Ev
+// CHECK-LP32: call L__ZN1SC1Ev
diff --git a/test/CodeGenCXX/default-destructor-synthesis.cpp b/test/CodeGenCXX/default-destructor-synthesis.cpp
index c9b48ed9c7..9cc802c85d 100644
--- a/test/CodeGenCXX/default-destructor-synthesis.cpp
+++ b/test/CodeGenCXX/default-destructor-synthesis.cpp
@@ -46,15 +46,15 @@ M gm;
int main() {M m1;}
-// CHECK-LP64: call __ZN1MC1Ev
-// CHECK-LP64: call __ZN1MD1Ev
-// CHECK-LP64: .globl __ZN1MD1Ev
-// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev
-// CHECK-LP64-NEXT: __ZN1MD1Ev:
-
-
-// CHECK-LP32: call L__ZN1MC1Ev
-// CHECK-LP32: call L__ZN1MD1Ev
-// CHECK-LP32: .globl __ZN1MD1Ev
-// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev
-// CHECK-LP32-NEXT: __ZN1MD1Ev:
+// CHECK-LP64: call __ZN1MC1Ev
+// CHECK-LP64: call __ZN1MD1Ev
+// CHECK-LP64: .globl __ZN1MD1Ev
+// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev
+// CHECK-LP64-NEXT: __ZN1MD1Ev:
+
+
+// CHECK-LP32: call L__ZN1MC1Ev
+// CHECK-LP32: call L__ZN1MD1Ev
+// CHECK-LP32: .globl __ZN1MD1Ev
+// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev
+// CHECK-LP32-NEXT:__ZN1MD1Ev:
diff --git a/test/CodeGenCXX/nested-base-member-access.cpp b/test/CodeGenCXX/nested-base-member-access.cpp
index aee7a12232..308f952c6d 100644
--- a/test/CodeGenCXX/nested-base-member-access.cpp
+++ b/test/CodeGenCXX/nested-base-member-access.cpp
@@ -35,14 +35,15 @@ struct P : Q, L {
struct N : M,P {
N() : M(100), P(200) {}
- void PR() { this->MPR(); this->PPR(); this->QPR();
- IQPR();
- printf("iM = %d\n", iM);
- printf("iP = %d\n", iP);
- printf("iQ = %d\n", iQ);
- printf("iL = %d\n", iL);
- printf("iIQ = %d\n", iIQ);
- }
+ void PR() {
+ this->MPR(); this->PPR(); this->QPR();
+ IQPR();
+ printf("iM = %d\n", iM);
+ printf("iP = %d\n", iP);
+ printf("iQ = %d\n", iQ);
+ printf("iL = %d\n", iL);
+ printf("iIQ = %d\n", iIQ);
+ }
};
int main() {
diff --git a/test/CodeGenCXX/virt.cpp b/test/CodeGenCXX/virt.cpp
index acc7853cd6..dfb705ae53 100644
--- a/test/CodeGenCXX/virt.cpp
+++ b/test/CodeGenCXX/virt.cpp
@@ -308,7 +308,7 @@ struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 {
// CHECK-LP32-NEXT: .space 4
// CHECK-LP32: .long 8
// CHECK-LP32 .space 4
-// CHECK-LP32 .space 4 FIXME
+// CHECK-LP32 .space 4 FIXME
// CHECK-LP32: .long 4
// CHECK-LP32-NEXT: .space 4
// CHECK-LP32-NEXT: .space 4
diff --git a/test/Lexer/comment-escape.c b/test/Lexer/comment-escape.c
index c568cd611f..c461457158 100644
--- a/test/Lexer/comment-escape.c
+++ b/test/Lexer/comment-escape.c
@@ -2,5 +2,5 @@
// rdar://6757323
// foo \
-#define blork 32
+#define blork 32
diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c
index d794fcfe8b..572ac44d1f 100644
--- a/test/Parser/MicrosoftExtensions.c
+++ b/test/Parser/MicrosoftExtensions.c
@@ -9,22 +9,22 @@ __declspec(noalias) __declspec(restrict) void * __cdecl xxx( void * _Memory );
typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR;
void * __ptr64 PtrToPtr64(const void *p)
{
- return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
+ return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
}
void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
{
- __asm {
- mov eax, Bit
- mov ecx, Base
- lock bts [ecx], eax
- setc al
- };
+ __asm {
+ mov eax, Bit
+ mov ecx, Base
+ lock bts [ecx], eax
+ setc al
+ };
}
void *_alloca(int);
void foo() {
- __declspec(align(16)) int *buffer = (int *)_alloca(9);
+ __declspec(align(16)) int *buffer = (int *)_alloca(9);
}
typedef bool (__stdcall __stdcall *blarg)(int);
diff --git a/test/Parser/cxx-friend.cpp b/test/Parser/cxx-friend.cpp
index 62637bdc8d..397894727b 100644
--- a/test/Parser/cxx-friend.cpp
+++ b/test/Parser/cxx-friend.cpp
@@ -6,7 +6,7 @@ class C {
class A {
public:
- void f();
+ void f();
};
friend int x; // expected-error {{'friend' used outside of class}}
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index 5f49fb15d7..94b7069afb 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/test/Parser/cxx-template-decl.cpp
@@ -50,7 +50,7 @@ template <typename T, typename U> struct B { };
// Template parameter shadowing
template<typename T, // expected-note{{template parameter is declared here}}
- typename T> // expected-error{{declaration of 'T' shadows template parameter}}
+ typename T> // expected-error{{declaration of 'T' shadows template parameter}}
void shadow1();
template<typename T> // expected-note{{template parameter is declared here}}
diff --git a/test/Preprocessor/assembler-with-cpp.c b/test/Preprocessor/assembler-with-cpp.c
index 2e84ed1a6b..f7706ca676 100644
--- a/test/Preprocessor/assembler-with-cpp.c
+++ b/test/Preprocessor/assembler-with-cpp.c
@@ -40,7 +40,7 @@
// rdar://6709206
// RUN: grep "5: expanded (" %t &&
#define M4 expanded
-#define M5() M4 ## (
+#define M5() M4 ## (
5: M5()
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index b7542b301b..c78fd29a89 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -144,12 +144,11 @@ int xx_sizecheck[(sizeof(xx) / sizeof(char)) == 5? 1 : -1];
static char const yy[5] = "test";
static char const zz[3] = "test"; // expected-warning{{initializer-string for char array is too long}}
-void charArrays()
-{
- static char const test[] = "test";
- int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1];
- static char const test2[] = { "weird stuff" };
- static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}}
+void charArrays() {
+ static char const test[] = "test";
+ int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1];
+ static char const test2[] = { "weird stuff" };
+ static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}}
char* cp[] = { "Hello" };
@@ -230,15 +229,15 @@ int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit)
// ptrs are constant
struct soft_segment_descriptor {
- long ssd_base;
+ long ssd_base;
};
static int dblfault_tss;
union uniao { int ola; } xpto[1];
struct soft_segment_descriptor gdt_segs[] = {
- {(long) &dblfault_tss},
- { (long)xpto},
+ {(long) &dblfault_tss},
+ { (long)xpto},
};
static void sppp_ipv6cp_up();
diff --git a/test/Sema/attr-deprecated.c b/test/Sema/attr-deprecated.c
index 6597bad4b5..e15381e4c6 100644
--- a/test/Sema/attr-deprecated.c
+++ b/test/Sema/attr-deprecated.c
@@ -21,7 +21,7 @@ int a() {
// test if attributes propagate to variables
extern int var;
int w() {
- return var; // expected-warning {{'var' is deprecated}}
+ return var; // expected-warning {{'var' is deprecated}}
}
int old_fn() __attribute__ ((deprecated));
diff --git a/test/Sema/block-call.c b/test/Sema/block-call.c
index c42b642337..893a8f61da 100644
--- a/test/Sema/block-call.c
+++ b/test/Sema/block-call.c
@@ -5,51 +5,47 @@ int (^IFP) ();
int (^II) (int);
int main() {
int (*FPL) (int) = FP; // C doesn't consider this an error.
-
+
// For Blocks, the ASTContext::typesAreBlockCompatible() makes sure this is an error.
int (^PFR) (int) = IFP; // OK
- PFR = II; // OK
-
- int (^IFP) () = PFR; // OK
-
+ PFR = II; // OK
- const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}}
+ int (^IFP) () = PFR; // OK
- const int (^CICC) () = CIC;
+ const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}}
- int * const (^IPCC) () = 0;
+ const int (^CICC) () = CIC;
- int * const (^IPCC1) () = IPCC;
+ int * const (^IPCC) () = 0;
- int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}}
+ int * const (^IPCC1) () = IPCC;
- int (^IPCC3) (const int) = PFR;
+ int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}}
+ int (^IPCC3) (const int) = PFR;
- int (^IPCC4) (int, char (^CArg) (double));
+ int (^IPCC4) (int, char (^CArg) (double));
+ int (^IPCC5) (int, char (^CArg) (double)) = IPCC4;
- int (^IPCC5) (int, char (^CArg) (double)) = IPCC4;
+ int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}}
- int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}}
-
- IPCC2 = 0;
- IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}}
- int (^x)() = 0;
- int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
- int a = 1;
- int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
+ IPCC2 = 0;
+ IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}}
+ int (^x)() = 0;
+ int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
+ int a = 1;
+ int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}}
}
int blah() {
- int (^IFP) (float);
- char (^PCP)(double, double, char);
+ int (^IFP) (float);
+ char (^PCP)(double, double, char);
- IFP(1.0);
- IFP (1.0, 2.0); // expected-error {{too many arguments to block call}}
+ IFP(1.0);
+ IFP (1.0, 2.0); // expected-error {{too many arguments to block call}}
- char ch = PCP(1.0, 2.0, 'a');
- return PCP(1.0, 2.0); // expected-error {{too few arguments to block}}
+ char ch = PCP(1.0, 2.0, 'a');
+ return PCP(1.0, 2.0); // expected-error {{too few arguments to block}}
}
-
diff --git a/test/Sema/block-explicit-return-type.c b/test/Sema/block-explicit-return-type.c
index c7b26b3d6b..f0a033dc0d 100644
--- a/test/Sema/block-explicit-return-type.c
+++ b/test/Sema/block-explicit-return-type.c
@@ -19,42 +19,39 @@ typedef void (^completion_block_t)(void);
typedef double (^myblock)(int);
double test(myblock I);
-int main()
-{
- __block int x = 1;
- __block int y = 2;
-
- (void)^void *{ return 0; };
-
- (void)^float(float y){ return y; };
-
- (void)^double (float y, double d)
- {
- if (y)
- return d;
- else
- return y;
- };
-
- const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) {
- if (flag)
- return 0;
- if (flag == 1)
- return arg;
- else if (flag == 2)
- return "";
- return arg1;
- };
-
- (void)^PF { return &gf; };
-
- some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
-
- double res = test(^(int z){x = y+z; return (double)z; });
+int main() {
+ __block int x = 1;
+ __block int y = 2;
+
+ (void)^void *{ return 0; };
+
+ (void)^float(float y){ return y; };
+
+ (void)^double (float y, double d) {
+ if (y)
+ return d;
+ else
+ return y;
+ };
+
+ const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) {
+ if (flag)
+ return 0;
+ if (flag == 1)
+ return arg;
+ else if (flag == 2)
+ return "";
+ return arg1;
+ };
+
+ (void)^PF { return &gf; };
+
+ some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
+
+ double res = test(^(int z){x = y+z; return (double)z; });
}
-void func()
-{
+void func() {
completion_block_t X;
completion_block_t (^blockx)(dispatch_item_t) = ^completion_block_t (dispatch_item_t item) {
@@ -66,7 +63,6 @@ void func()
};
blockx = blocky;
-
}
diff --git a/test/Sema/block-literal.c b/test/Sema/block-literal.c
index c4aadd5d48..9f5022dc63 100644
--- a/test/Sema/block-literal.c
+++ b/test/Sema/block-literal.c
@@ -12,34 +12,34 @@ void takeblock(T);
int takeintint(int (^C)(int)) { return C(4); }
T somefunction() {
- if (^{ })
- nothing();
+ if (^{ })
+ nothing();
- noop = ^{};
+ noop = ^{};
- noop = ^{printf("\nClosure\n"); };
+ noop = ^{printf("\nClosure\n"); };
- I(^{ });
+ I(^{ });
- return ^{printf("\nClosure\n"); };
+ return ^{printf("\nClosure\n"); };
}
void test2() {
- int x = 4;
+ int x = 4;
- takeblock(^{ printf("%d\n", x); });
+ takeblock(^{ printf("%d\n", x); });
while (1) {
- takeblock(^{
- break; // expected-error {{'break' statement not in loop or switch statement}}
- continue; // expected-error {{'continue' statement not in loop statement}}
- while(1) break; // ok
- goto foo; // expected-error {{goto not allowed}}
- });
+ takeblock(^{
+ break; // expected-error {{'break' statement not in loop or switch statement}}
+ continue; // expected-error {{'continue' statement not in loop statement}}
+ while(1) break; // ok
+ goto foo; // expected-error {{goto not allowed}}
+ });
break;
- }
+ }
-foo:
- takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
+ foo:
+ takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
__block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}}
takeblock(^{ y = 8; });
}
@@ -59,11 +59,11 @@ void myfunc(int (^block)(int)) {}
void myfunc3(const int *x);
void test5() {
- int a;
+ int a;
- myfunc(^(int abcd) {
- myfunc3(&a);
- return 1;
+ myfunc(^(int abcd) {
+ myfunc3(&a);
+ return 1;
});
}
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index a9a7df61fe..8661fd8a52 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -4,37 +4,37 @@ void donotwarn();
int (^IFP) ();
int (^II) (int);
int test1() {
- int (^PFR) (int) = 0; // OK
- PFR = II; // OK
+ int (^PFR) (int) = 0; // OK
+ PFR = II; // OK
- if (PFR == II) // OK
+ if (PFR == II) // OK
donotwarn();
- if (PFR == IFP) // OK
+ if (PFR == IFP) // OK
donotwarn();
if (PFR == (int (^) (int))IFP) // OK
donotwarn();
- if (PFR == 0) // OK
+ if (PFR == 0) // OK
donotwarn();
- if (PFR) // OK
+ if (PFR) // OK
donotwarn();
- if (!PFR) // OK
+ if (!PFR) // OK
donotwarn();
- return PFR != IFP; // OK
+ return PFR != IFP; // OK
}
int test2(double (^S)()) {
double (^I)(int) = (void*) S;
- (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
+ (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
void *pv = I;
- pv = S;
+ pv = S;
I(1);
@@ -114,7 +114,7 @@ void test11(int i) {
void (^test12f)(void);
void test12() {
- test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
+ test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
}
// rdar://6808730
@@ -144,7 +144,7 @@ void foo(long (^comp)()) {
void (^test15f)(void);
void test15() {
- foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}}
+ foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}}
}
__block int test16i; // expected-error {{__block attribute not allowed, only allowed on local variables}}
diff --git a/test/Sema/block-printf-attribute-1.c b/test/Sema/block-printf-attribute-1.c
index ce30b8e855..4941ae7bc6 100644
--- a/test/Sema/block-printf-attribute-1.c
+++ b/test/Sema/block-printf-attribute-1.c
@@ -1,15 +1,12 @@
// RUN: clang-cc %s -fsyntax-only -verify -fblocks
-int main()
-{
- void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}}
- ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}}
+int main() {
+ void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}}
+ ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}}
- void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
-
- // FIXME: argument type poking not yet supportted.
- z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */
- z(1, "%s", "HELLO"); // OK
+ void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
+ // FIXME: argument type poking not yet supportted.
+ z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */
+ z(1, "%s", "HELLO"); // OK
}
-
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c
index 96dde363de..98a72731d6 100644
--- a/test/Sema/block-return.c
+++ b/test/Sema/block-return.c
@@ -31,7 +31,7 @@ CL foo() {
return (float)1.0;
else
if (2)
- return (double)2.0;
+ return (double)2.0;
return 1;
};
char *(^B)(void) = ^{
@@ -66,7 +66,7 @@ int foo3() {
Boolean (*value_equal)(uintptr_t, uintptr_t) = 0;
cb.isEqual = ^(const CFBasicHash *table, uintptr_t stack_value_or_key1, uintptr_t stack_value_or_key2, Boolean is_key) {
- return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2);
+ return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2);
};
}
diff --git a/test/Sema/block-sentinel-attribute.c b/test/Sema/block-sentinel-attribute.c
index a7d4df108e..5628a2c780 100644
--- a/test/Sema/block-sentinel-attribute.c
+++ b/test/Sema/block-sentinel-attribute.c
@@ -2,24 +2,23 @@
void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
-int main()
-{
- void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}}
- void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}}
- ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
- void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
+int main() {
+ void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}}
+ void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}}
+ ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
+ void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
- void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
+ void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}
- b(1, "%s", (void*)0); // OK
- b(1, "%s", 0); // expected-warning {{missing sentinel in block call}}
- z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}}
- z(1, "%s", (void*)0, 1, 0); // OK
+ b(1, "%s", (void*)0); // OK
+ b(1, "%s", 0); // expected-warning {{missing sentinel in block call}}
+ z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}}
+ z(1, "%s", (void*)0, 1, 0); // OK
- y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}}
+ y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}}
- y(1, "%s", (void*)0,3,4,5,6,7); // OK
+ y(1, "%s", (void*)0,3,4,5,6,7); // OK
}
diff --git a/test/Sema/c89-2.c b/test/Sema/c89-2.c
index 3b546404a9..50c5f4e5a8 100644
--- a/test/Sema/c89-2.c
+++ b/test/Sema/c89-2.c
@@ -1,5 +1,5 @@
/* RUN: clang-cc %s -std=c89 -pedantic-errors -verify
*/
-#if 1LL /* expected-error {{long long}} */
+#if 1LL /* expected-error {{long long}} */
#endif
diff --git a/test/Sema/c89.c b/test/Sema/c89.c
index 9bf720b6a3..fc50ebed66 100644
--- a/test/Sema/c89.c
+++ b/test/Sema/c89.c
@@ -25,7 +25,7 @@ void test3(int i) {
int A[i]; /* expected-warning {{variable length array}} */
}
-int test4 = 0LL; /* expected-warning {{long long}} */
+int test4 = 0LL; /* expected-warning {{long long}} */
/* PR1999 */
void test5(register);
diff --git a/test/Sema/complex-int.c b/test/Sema/complex-int.c
index 5977b4d1e0..6c660899e8 100644
--- a/test/Sema/complex-int.c
+++ b/test/Sema/complex-int.c
@@ -44,9 +44,8 @@ TestPairs(7); TestPairs(8);
// rdar://6097730
void test3(_Complex int *x) {
*x = ~*x;
-}
+}
void test4(_Complex float *x) {
*x = ~*x;
-}
-
+}
diff --git a/test/Sema/conditional.c b/test/Sema/conditional.c
index 1c7486a613..9f48c349c9 100644
--- a/test/Sema/conditional.c
+++ b/test/Sema/conditional.c
@@ -4,12 +4,10 @@ const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r";
void _efree(void *ptr);
-int _php_stream_free1()
-{
- return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
+int _php_stream_free1() {
+ return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
}
-int _php_stream_free2()
-{
- return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
+int _php_stream_free2() {
+ return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
}
diff --git a/test/Sema/darwin-align-cast.c b/test/Sema/darwin-align-cast.c
index 313a9e3410..fed8983191 100644
--- a/test/Sema/darwin-align-cast.c
+++ b/test/Sema/darwin-align-cast.c
@@ -8,10 +8,10 @@ struct cmsghdr {};
#if 0
This code below comes from the following system headers:
-sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct
+sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct
cmsghdr)) + __DARWIN_ALIGN(l))
-i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p)
+i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p)
+ __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#endif
diff --git a/test/Sema/floating-point-compare.c b/test/Sema/floating-point-compare.c
index 763a8f4b86..9888105518 100644
--- a/test/Sema/floating-point-compare.c
+++ b/test/Sema/floating-point-compare.c
@@ -13,11 +13,11 @@ int f3(float x) {
}
int f4(float x) {
- return x == 0.0; // no-warning {{comparing}}
+ return x == 0.0; // no-warning {{comparing}}
}
int f5(float x) {
- return x == __builtin_inf(); // no-warning
+ return x == __builtin_inf(); // no-warning
}
int f7(float x) {
diff --git a/test/Sema/function-pointer-sentinel-attribute.c b/test/Sema/function-pointer-sentinel-attribute.c
index 0de02fa536..6d3fb17180 100644
--- a/test/Sema/function-pointer-sentinel-attribute.c
+++ b/test/Sema/function-pointer-sentinel-attribute.c
@@ -2,22 +2,19 @@
void (*e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
-int main()
-{
- void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}}
- void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}}
+int main() {
+ void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}}
+ void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}}
- void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}}
+ void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}}
- b(1, "%s", (void*)0); // OK
- b(1, "%s", 0); // expected-warning {{missing sentinel in function call}}
- z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}}
- z(1, "%s", (void*)0, 1, 0); // OK
+ b(1, "%s", (void*)0); // OK
+ b(1, "%s", 0); // expected-warning {{missing sentinel in function call}}
+ z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}}
+ z(1, "%s", (void*)0, 1, 0); // OK
- y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
-
- y(1, "%s", (void*)0,3,4,5,6,7); // OK
+ y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
+ y(1, "%s", (void*)0,3,4,5,6,7); // OK
}
-
diff --git a/test/Sema/function-sentinel-attr.c b/test/Sema/function-sentinel-attr.c
index 6630479612..b33b4a063c 100644
--- a/test/Sema/function-sentinel-attr.c
+++ b/test/Sema/function-sentinel-attr.c
@@ -18,7 +18,7 @@ int main ()
foo1(1, 0) ; // expected-warning {{missing sentinel in function call}}
foo5(1, NULL, 2); // OK
foo5(1,2,NULL, 1); // OK
- foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}}
+ foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}}
foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}}
foo6(1,NULL,3,4,5,6,7); // OK
diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c
index 1a81cc55b5..5190bdbf93 100644
--- a/test/Sema/implicit-int.c
+++ b/test/Sema/implicit-int.c
@@ -12,15 +12,15 @@ void f((x)); // expected-warning {{type specifier missing, defaults to 'int'}}
// PR3702
#define PAD(ms10) { \
- register i; \
+ register i; \
}
-#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
+#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
void
h19_insline(n) // expected-warning {{parameter 'n' was not declared, defaulting to type 'int'}}
{
- ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}}
+ ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}}
}
struct foo {
diff --git a/test/Sema/predefined-function.c b/test/Sema/predefined-function.c
index e8ccb3636b..c8d17f0078 100644
--- a/test/Sema/predefined-function.c
+++ b/test/Sema/predefined-function.c
@@ -8,31 +8,30 @@ int eli(float b); // expected-note {{previous declaration is here}}
int b(int c) {return 1;}
int foo();
-int foo()
-{
- int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
- eli(b); // expected-error{{incompatible type passing}}
- return 0;
+int foo() {
+ int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
+ eli(b); // expected-error{{incompatible type passing}}
+ return 0;
}
int bar();
int bar(int i) // expected-note {{previous definition is here}}
{
- return 0;
+ return 0;
}
int bar() // expected-error {{redefinition of 'bar'}}
{
- return 0;
+ return 0;
}
int foobar(int); // note {{previous declaration is here}}
int foobar() // error {{conflicting types for 'foobar'}}
{
- return 0;
+ return 0;
}
int wibble(); // expected-note {{previous declaration is here}}
float wibble() // expected-error {{conflicting types for 'wibble'}}
{
- return 0.0f;
+ return 0.0f;
}
diff --git a/test/Sema/static-init.c b/test/Sema/static-init.c
index cd495568ca..510f3ab099 100644
--- a/test/Sema/static-init.c
+++ b/test/Sema/static-init.c
@@ -11,11 +11,11 @@ _Bool t = &t;
union bar {
- int i;
+ int i;
};
struct foo {
- unsigned ptr;
+ unsigned ptr;
};
union bar u[1];
diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c
index 2c0945f9f8..a5a299bf09 100644
--- a/test/Sema/struct-decl.c
+++ b/test/Sema/struct-decl.c
@@ -1,26 +1,26 @@
// RUN: clang-cc -fsyntax-only -verify %s
// PR3459
struct bar {
- char n[1];
+ char n[1];
};
struct foo {
- char name[(int)&((struct bar *)0)->n];
- char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
+ char name[(int)&((struct bar *)0)->n];
+ char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
};
// PR3430
struct s {
- struct st {
- int v;
- } *ts;
+ struct st {
+ int v;
+ } *ts;
};
struct st;
int foo() {
- struct st *f;
- return f->v + f[0].v;
+ struct st *f;
+ return f->v + f[0].v;
}
// PR3642, PR3671
@@ -29,8 +29,8 @@ struct pppoe_tag {
char tag_data[];
};
struct datatag {
- struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
- char data;
+ struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
+ char data;
};
diff --git a/test/Sema/transparent-union-pointer.c b/test/Sema/transparent-union-pointer.c
index ea761f17e7..a58bd42f82 100644
--- a/test/Sema/transparent-union-pointer.c
+++ b/test/Sema/transparent-union-pointer.c
@@ -1,14 +1,14 @@
// RUN: clang-cc %s -fsyntax-only -verify
typedef union {
- union wait *__uptr;
- int *__iptr;
+ union wait *__uptr;
+ int *__iptr;
} __WAIT_STATUS __attribute__ ((__transparent_union__));
extern int wait (__WAIT_STATUS __stat_loc);
void fastcgi_cleanup() {
- int status = 0;
- wait(&status);
+ int status = 0;
+ wait(&status);
}
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp
index 2d466c203d..e14304a26f 100644
--- a/test/SemaCXX/abstract.cpp
+++ b/test/SemaCXX/abstract.cpp
@@ -9,7 +9,7 @@
#endif
class C {
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
static_assert(__is_abstract(C), "C has a pure virtual function");
@@ -20,7 +20,7 @@ class D : C {
static_assert(__is_abstract(D), "D inherits from an abstract class");
class E : D {
- virtual void f();
+ virtual void f();
};
static_assert(!__is_abstract(E), "E inherits from an abstract class but implements f");
@@ -38,8 +38,8 @@ struct S {
void t3(const C&);
void f() {
- C(); // expected-error {{allocation of an object of abstract type 'C'}}
- t3(C()); // expected-error {{allocation of an object of abstract type 'C'}}
+ C(); // expected-error {{allocation of an object of abstract type 'C'}}
+ t3(C()); // expected-error {{allocation of an object of abstract type 'C'}}
}
C e1[2]; // expected-error {{variable type 'C' is an abstract class}}
@@ -54,17 +54,17 @@ typedef void (*Func)(C); // expected-error {{parameter type 'C' is an abstract c
void t6(Func);
class F {
- F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}}
+ F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}}
- class D {
- void f(F c); // expected-error {{parameter type 'F' is an abstract class}}
- };
+ class D {
+ void f(F c); // expected-error {{parameter type 'F' is an abstract class}}
+ };
- union U {
- void u(F c); // expected-error {{parameter type 'F' is an abstract class}}
- };
+ union U {
+ void u(F c); // expected-error {{parameter type 'F' is an abstract class}}
+ };
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
class Abstract;
@@ -72,50 +72,47 @@ class Abstract;
void t7(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
void t8() {
- void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+ void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
}
namespace N {
- void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
}
class Abstract {
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
// <rdar://problem/6854087>
class foo {
public:
- virtual foo *getFoo() = 0;
+ virtual foo *getFoo() = 0;
};
class bar : public foo {
public:
- virtual bar *getFoo();
+ virtual bar *getFoo();
};
bar x;
// <rdar://problem/6902298>
-class A
-{
+class A {
public:
- virtual void release() = 0;
- virtual void release(int count) = 0;
- virtual void retain() = 0;
+ virtual void release() = 0;
+ virtual void release(int count) = 0;
+ virtual void retain() = 0;
};
-class B : public A
-{
+class B : public A {
public:
- virtual void release();
- virtual void release(int count);
- virtual void retain();
+ virtual void release();
+ virtual void release(int count);
+ virtual void retain();
};
-void foo(void)
-{
- B b;
+void foo(void) {
+ B b;
}
struct K {
diff --git a/test/SemaCXX/access-control-check.cpp b/test/SemaCXX/access-control-check.cpp
index d2acfe4167..fb124a932a 100644
--- a/test/SemaCXX/access-control-check.cpp
+++ b/test/SemaCXX/access-control-check.cpp
@@ -11,6 +11,6 @@ class P {
class N : M,P {
N() {}
- // FIXME. No access violation is reported in method call or member access.
+ // FIXME. No access violation is reported in method call or member access.
int PR() { return iP + PPR(); }
};
diff --git a/test/SemaCXX/attr-format.cpp b/test/SemaCXX/attr-format.cpp
index d1659c98de..369099a848 100644
--- a/test/SemaCXX/attr-format.cpp
+++ b/test/SemaCXX/attr-format.cpp
@@ -1,8 +1,8 @@
// RUN: clang-cc -fsyntax-only -verify %s
struct S {
- static void f(const char*, ...) __attribute__((format(printf, 1, 2)));
-
- // GCC has a hidden 'this' argument in member functions which is why
- // the format argument is argument 2 here.
- void g(const char*, ...) __attribute__((format(printf, 2, 3)));
-}; \ No newline at end of file
+ static void f(const char*, ...) __attribute__((format(printf, 1, 2)));
+
+ // GCC has a hidden 'this' argument in member functions which is why
+ // the format argument is argument 2 here.
+ void g(const char*, ...) __attribute__((format(printf, 2, 3)));
+};
diff --git a/test/SemaCXX/class-base-member-init.cpp b/test/SemaCXX/class-base-member-init.cpp
index c38c3d3337..2092847bc0 100644
--- a/test/SemaCXX/class-base-member-init.cpp
+++ b/test/SemaCXX/class-base-member-init.cpp
@@ -7,9 +7,9 @@ public:
struct D : S {
D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \
- // expected-note {{previous initialization is here}} \
- // expected-error {{multiple initializations given for base 'class S'}} \
- // expected-note {{previous initialization is here}}
+ // expected-note {{previous initialization is here}} \
+ // expected-error {{multiple initializations given for base 'class S'}} \
+ // expected-note {{previous initialization is here}}
int b1;
int b2;
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp
index 1a7787ee0e..b86a27d66d 100644
--- a/test/SemaCXX/constructor-initializer.cpp
+++ b/test/SemaCXX/constructor-initializer.cpp
@@ -94,18 +94,18 @@ struct Current : Derived {
Derived::V(), // expected-note {{base 'Derived::V'}}
::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
INT::NonExisting() {} // expected-error {{expected a class or namespace}} \
- // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
+ // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
};
// FIXME. This is bad message!
-struct M { // expected-note {{candidate function}} \
- // expected-note {{candidate function}}
- M(int i, int j); // expected-note {{candidate function}} \
- // // expected-note {{candidate function}}
+struct M { // expected-note {{candidate function}} \
+ // expected-note {{candidate function}}
+ M(int i, int j); // expected-note {{candidate function}} \
+ // // expected-note {{candidate function}}
};
struct N : M {
- N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}}
+ N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}}
m1(100) { } // expected-error {{no matching constructor for initialization of 'm1'}}
M m1;
};
@@ -116,7 +116,7 @@ struct P : M { // expected-error {{default constructor for 'struct M' is missin
};
struct Q {
- Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}}
+ Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}}
pf(0.0) { } // expected-error {{incompatible type passing 'double', expected 'float *'}}
float f1;
diff --git a/test/SemaCXX/copy-constructor-error.cpp b/test/SemaCXX/copy-constructor-error.cpp
index afe741faa4..2e42fcc3b1 100644
--- a/test/SemaCXX/copy-constructor-error.cpp
+++ b/test/SemaCXX/copy-constructor-error.cpp
@@ -1,8 +1,8 @@
// RUN: clang-cc -fsyntax-only -verify %s
-struct S { // expected-note {{candidate function}}
- S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\
- // expected-note {{candidate function}}
+struct S { // expected-note {{candidate function}}
+ S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\
+ // expected-note {{candidate function}}
};
S f();
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp
index 64ea49837b..e627fefdef 100644
--- a/test/SemaCXX/default-assignment-operator.cpp
+++ b/test/SemaCXX/default-assignment-operator.cpp
@@ -26,7 +26,7 @@ Z z2;
// Test1
void f(X x, const X cx) {
- x = cx; // expected-note {{synthesized method is first required here}}
+ x = cx; // expected-note {{synthesized method is first required here}}
x = cx;
z1 = z2;
}
@@ -36,8 +36,7 @@ class T {};
T t1;
T t2;
-void g()
-{
+void g() {
t1 = t2;
}
@@ -51,8 +50,7 @@ public:
class W : V {};
W w1, w2;
-void h()
-{
+void h() {
w1 = w2;
}
@@ -67,9 +65,8 @@ public:
class D1 : B1 {};
D1 d1, d2;
-void i()
-{
- d1 = d2;
+void i() {
+ d1 = d2;
}
// Test5
@@ -83,8 +80,7 @@ public:
E1 e1, e2;
-void j()
-{
+void j() {
e1 = e2; // expected-note{{synthesized method is first required here}}
}
diff --git a/test/SemaCXX/default-constructor-initializers.cpp b/test/SemaCXX/default-constructor-initializers.cpp
index 12149e55a7..a6db6a7d9a 100644
--- a/test/SemaCXX/default-constructor-initializers.cpp
+++ b/test/SemaCXX/default-constructor-initializers.cpp
@@ -46,9 +46,9 @@ Y4 y4;
struct Z1 {
- int& z; // expected-note {{declared at}}
- const int c1; // expected-note {{declared at}}
- volatile int v1;
+ int& z; // expected-note {{declared at}}
+ const int c1; // expected-note {{declared at}}
+ volatile int v1;
};
Z1 z1; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \
diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp
index 9668c84693..431f457259 100644
--- a/test/SemaCXX/enum.cpp
+++ b/test/SemaCXX/enum.cpp
@@ -14,14 +14,13 @@ void f() {
// <rdar://problem/6502934>
typedef enum Foo {
- A = 0,
- B = 1
+ A = 0,
+ B = 1
} Foo;
-
-
+
void bar() {
- Foo myvar = A;
- myvar = B;
+ Foo myvar = A;
+ myvar = B;
}
/// PR3688
diff --git a/test/SemaCXX/illegal-member-initialization.cpp b/test/SemaCXX/illegal-member-initialization.cpp
index 8cedb6f73b..2d7c73d68a 100644
--- a/test/SemaCXX/illegal-member-initialization.cpp
+++ b/test/SemaCXX/illegal-member-initialization.cpp
@@ -3,7 +3,7 @@
struct A {
A() : value(), cvalue() { } // expected-error {{cannot initialize the member to null in default constructor because reference member 'value' cannot be null-initialized}} \
// expected-error {{constructor for 'struct A' must explicitly initialize the reference member 'value'}}
- int &value; // expected-note{{declared at}} {{expected-note{{declared at}}
+ int &value; // expected-note{{declared at}} {{expected-note{{declared at}}
const int cvalue;
};
@@ -11,10 +11,10 @@ struct B {
};
struct X {
- X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \
- // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}}
+ X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \
+ // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}}
int &value; // expected-note{{declared at}}
const int cvalue; // expected-note{{declared at}}
B& b; // expected-note{{declared at}}
diff --git a/test/SemaCXX/inherit.cpp b/test/SemaCXX/inherit.cpp
index eaad97cc82..069e30d0cd 100644
--- a/test/SemaCXX/inherit.cpp
+++ b/test/SemaCXX/inherit.cpp
@@ -10,7 +10,7 @@ class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base
class C : public B1, private B2 { };
-class D; // expected-note {{forward declaration of 'class D'}}
+class D; // expected-note {{forward declaration of 'class D'}}
class E : public D { }; // expected-error{{base class has incomplete type}}
diff --git a/test/SemaCXX/member-expr-static.cpp b/test/SemaCXX/member-expr-static.cpp
index b6495a8520..2fa7e0781c 100644
--- a/test/SemaCXX/member-expr-static.cpp
+++ b/test/SemaCXX/member-expr-static.cpp
@@ -2,20 +2,18 @@
typedef void (*thread_continue_t)();
extern "C" {
-extern void kernel_thread_start(thread_continue_t continuation);
-extern void pure_c(void);
+ extern void kernel_thread_start(thread_continue_t continuation);
+ extern void pure_c(void);
}
-class _IOConfigThread
-{
+class _IOConfigThread {
public:
- static void main( void );
+ static void main( void );
};
-void foo( void )
-{
- kernel_thread_start(&_IOConfigThread::main);
- kernel_thread_start((thread_continue_t)&_IOConfigThread::main);
- kernel_thread_start(&pure_c);
+void foo( void ) {
+ kernel_thread_start(&_IOConfigThread::main);
+ kernel_thread_start((thread_continue_t)&_IOConfigThread::main);
+ kernel_thread_start(&pure_c);
}
diff --git a/test/SemaCXX/static-initializers.cpp b/test/SemaCXX/static-initializers.cpp
index 3d92a532ae..a651243df7 100644
--- a/test/SemaCXX/static-initializers.cpp
+++ b/test/SemaCXX/static-initializers.cpp
@@ -1,12 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
-int f()
-{
- return 10;
+int f() {
+ return 10;
}
-void g()
-{
- static int a = f();
+void g() {
+ static int a = f();
}
static int b = f();
diff --git a/test/SemaCXX/warn-reorder-ctor-initialization.cpp b/test/SemaCXX/warn-reorder-ctor-initialization.cpp
index a1990329ac..bfce588b57 100644
--- a/test/SemaCXX/warn-reorder-ctor-initialization.cpp
+++ b/test/SemaCXX/warn-reorder-ctor-initialization.cpp
@@ -64,13 +64,13 @@ struct B1 {
};
struct F : public A1, public B1, private virtual V {
- F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \
- // expected-note {{base 'struct V'}}
+ F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \
+ // expected-note {{base 'struct V'}}
};
struct X : public virtual A, virtual V, public virtual B {
- X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \
- // expected-note {{base 'struct V'}}
+ X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \
+ // expected-note {{base 'struct V'}}
};
class Anon {