1 /* ===-- gcc_personality_test.c - Tests __gcc_personality_v0 -------------===
3 * The LLVM Compiler Infrastructure
5 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
8 * ===----------------------------------------------------------------------===
15 extern void foo_clean(void* x
);
16 extern void bar_clean(void* x
);
17 extern void register_foo_local(int* x
);
18 extern void register_bar_local(int* x
);
19 extern void done_foo();
20 extern void done_bar();
24 * foo() is called by main() in gcc_personality_test_helper.cxx.
25 * done_bar() is implemented in C++ and will throw an exception.
26 * main() will catch the exception and verify that the cleanup
27 * routines for foo() and bar() were called by the personality
32 int x
__attribute__((cleanup(bar_clean
))) = 0;
33 register_bar_local(&x
);
38 int x
__attribute__((cleanup(foo_clean
))) = 0;
39 register_foo_local(&x
);