Timur Iskhodzhanov | 8560791 | 2012-04-20 08:05:00 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s |
| 2 | |
| 3 | class A { |
| 4 | public: |
| 5 | A() { } |
| 6 | ~A() { } |
| 7 | }; |
| 8 | |
| 9 | void no_contstructor_destructor_infinite_recursion() { |
| 10 | A a; |
| 11 | |
John McCall | bd31574 | 2012-09-25 08:00:39 +0000 | [diff] [blame^] | 12 | // CHECK: define linkonce_odr x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ"(%class.A* %this) |
| 13 | // CHECK-NEXT: entry: |
| 14 | // CHECK-NEXT: %this.addr = alloca %class.A*, align 4 |
| 15 | // CHECK-NEXT: store %class.A* %this, %class.A** %this.addr, align 4 |
| 16 | // CHECK-NEXT: %this1 = load %class.A** %this.addr |
| 17 | // CHECK-NEXT: ret %class.A* %this1 |
| 18 | // CHECK-NEXT: } |
Timur Iskhodzhanov | 8560791 | 2012-04-20 08:05:00 +0000 | [diff] [blame] | 19 | |
| 20 | // Make sure that the destructor doesn't call itself: |
| 21 | // CHECK: define {{.*}} @"\01??1A@@QAE@XZ" |
| 22 | // CHECK-NOT: call void @"\01??1A@@QAE@XZ" |
| 23 | // CHECK: ret |
| 24 | } |
John McCall | bd31574 | 2012-09-25 08:00:39 +0000 | [diff] [blame^] | 25 | |