1 // RUN: %clang_cc1 -I%S %s -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -o - | FileCheck %s 2 struct A { virtual void f(); }; 3 struct B : A { }; 4 5 // CHECK: {{define.*@_Z1fP1A}} 6 B fail; f(A * a)7const B& f(A *a) { 8 try { 9 // CHECK: call i8* @__dynamic_cast 10 // CHECK: br i1 11 // CHECK: invoke void @__cxa_bad_cast() noreturn 12 dynamic_cast<const B&>(*a); 13 } catch (...) { 14 // CHECK: call i8* @llvm.eh.exception 15 } 16 return fail; 17 } 18