diff options
Diffstat (limited to 'clang/test/CodeGenCXX/constructor-conversion.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/constructor-conversion.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/clang/test/CodeGenCXX/constructor-conversion.cpp b/clang/test/CodeGenCXX/constructor-conversion.cpp index 3fafe617699..980b230118d 100644 --- a/clang/test/CodeGenCXX/constructor-conversion.cpp +++ b/clang/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 |