Home | History | Annotate | Download | only in CodeGenCXX
      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;
      7 const 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:      landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
     15     // CHECK-NEXT:   catch i8* null
     16   }
     17   return fail;
     18 }
     19