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/CodeGenCXX | |
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/CodeGenCXX')
-rw-r--r-- | test/CodeGenCXX/constructor-conversion.cpp | 35 | ||||
-rw-r--r-- | test/CodeGenCXX/constructor-default-arg.cpp | 36 | ||||
-rw-r--r-- | test/CodeGenCXX/constructor-for-array-members.cpp | 9 | ||||
-rw-r--r-- | test/CodeGenCXX/constructor-init.cpp | 27 | ||||
-rw-r--r-- | test/CodeGenCXX/constructor-template.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/conversion-function.cpp | 80 | ||||
-rw-r--r-- | test/CodeGenCXX/copy-assign-synthesis-1.cpp | 14 | ||||
-rw-r--r-- | test/CodeGenCXX/copy-constructor-elim.cpp | 29 | ||||
-rw-r--r-- | test/CodeGenCXX/copy-constructor-synthesis.cpp | 79 | ||||
-rw-r--r-- | test/CodeGenCXX/default-constructor-for-members.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/default-destructor-synthesis.cpp | 24 | ||||
-rw-r--r-- | test/CodeGenCXX/nested-base-member-access.cpp | 17 | ||||
-rw-r--r-- | test/CodeGenCXX/virt.cpp | 2 |
13 files changed, 180 insertions, 180 deletions
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 |