dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / weak-override-shared-cache.dtest / main.cpp
1
2 // BUILD: $CC main.cpp -lc++ -o $BUILD_DIR/weak-override-shared-cache.exe
3
4 // RUN: ./weak-override-shared-cache.exe
5
6
7 #include <stdexcept>
8 #include <stdio.h>
9
10 // Hack to get a strong definition of this symbol
11 __attribute__((used))
12 void* hack __asm("__ZTISt16nested_exception");
13
14 #include "test_support.h"
15
16 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
17 try {
18 throw new std::nested_exception();
19 } catch (std::nested_exception* e) {
20 PASS("Success");
21 }
22 FAIL("Expected exception to be thrown");
23 }
24