mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Add another testcase I found lying around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
206c7d029d
commit
81f0dbdc23
23
test/C++Frontend/EH/ctor_dtor_count.cpp
Normal file
23
test/C++Frontend/EH/ctor_dtor_count.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
|
||||
static int c;
|
||||
|
||||
struct A {
|
||||
A() { ++c; }
|
||||
A(const A&) { ++c; }
|
||||
~A() { --c; }
|
||||
};
|
||||
|
||||
struct B {
|
||||
A a;
|
||||
B() { A a; throw 1; }
|
||||
};
|
||||
|
||||
int main() {
|
||||
try {
|
||||
B b;
|
||||
} catch (...) {}
|
||||
if (!c) printf("All ok!\n");
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user