diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-27 03:03:08 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-27 03:03:08 +0000 |
commit | 202e42b9bf622cd474191cbcdece658d5ef3fd8f (patch) | |
tree | 0bc3ef42674fe379c3073b51bebada7bcd96eef9 /test/CodeGenCXX/default-destructor-synthesis.cpp | |
parent | 577cacc0a3d4b6c2130c25bbe0c949623590fee3 (diff) |
Fix test/CodeGenCXX/default-destructor-synthesis.cpp not to rely on asm output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94652 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/default-destructor-synthesis.cpp')
-rw-r--r-- | test/CodeGenCXX/default-destructor-synthesis.cpp | 72 |
1 files changed, 25 insertions, 47 deletions
diff --git a/test/CodeGenCXX/default-destructor-synthesis.cpp b/test/CodeGenCXX/default-destructor-synthesis.cpp index 71167a204f..fac5cc01f6 100644 --- a/test/CodeGenCXX/default-destructor-synthesis.cpp +++ b/test/CodeGenCXX/default-destructor-synthesis.cpp @@ -1,58 +1,36 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s -// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s -// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s -// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s - -extern "C" int printf(...); - -int count = 1; +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O2 -o - | FileCheck %s +static int count = 0; struct S { - S() : iS(count++), fS(1.23) {}; - ~S(){printf("S::~S(%d, %f)\n", iS, fS); }; - int iS; - float fS; + S() { count++; } + ~S() { count--; } }; -struct Q { - Q() : iQ(count++), dQ(2.34) {}; - ~Q(){printf("Q::~Q(%d, %f)\n", iQ, dQ); }; - int iQ; - double dQ; +struct P { + P() { count++; } + ~P() { count--; } }; -struct P { - P() : fP(3.45) , iP(count++) {}; - ~P(){printf("P::~P(%d, %f)\n", iP, fP); }; - float fP; - int iP; +struct Q { + Q() { count++; } + ~Q() { count--; } }; -struct M : Q, P { +struct M : Q, P { S s; - Q q; - - P p; - - P p_arr[3]; - - Q q_arr[2][3]; - + P p; + P p_arr[3]; + Q q_arr[2][3]; }; - -M gm; - -int main() {M m1;} - -// CHECK-LP64: .globl __ZN1MD1Ev -// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev -// CHECK-LP64-NEXT: __ZN1MD1Ev: -// CHECK-LP64: callq __ZN1MC1Ev -// CHECK-LP64: callq __ZN1MD1Ev - -// CHECK-LP32: .globl __ZN1MD1Ev -// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev -// CHECK-LP32-NEXT:__ZN1MD1Ev: -// CHECK-LP32: call L__ZN1MC1Ev -// CHECK-LP32: call L__ZN1MD1Ev + +// CHECK: define i32 @_Z1fv() nounwind +int f() { + { + count = 1; + M a; + } + + // CHECK: ret i32 1 + return count; +} |