brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4ee55c6 Raw
53 lines · plain
1; REQUIRES: system-darwin && host-unwind-supports-jit2; RUN: lli -jit-kind=orc %s3;4; Basic correctness testing for eh-frame processing and registration.5 6@_ZTIi = external constant ptr7 8declare ptr @__cxa_allocate_exception(i64)9declare void @__cxa_throw(ptr, ptr, ptr)10 11declare i32 @__gxx_personality_v0(...)12declare i32 @llvm.eh.typeid.for(ptr)13declare ptr @__cxa_begin_catch(ptr)14declare void @__cxa_end_catch()15 16define void @explode() {17entry:18  %exception = tail call ptr @__cxa_allocate_exception(i64 4)19  store i32 42, ptr %exception, align 1620  tail call void @__cxa_throw(ptr %exception, ptr @_ZTIi, ptr null)21  unreachable22}23 24define i32 @main(i32 %argc, ptr %argv) personality ptr @__gxx_personality_v0 {25entry:26  invoke void @explode()27          to label %return unwind label %lpad28 29lpad:30  %0 = landingpad { ptr, i32 }31          catch ptr @_ZTIi32  %1 = extractvalue { ptr, i32 } %0, 133  %2 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)34  %matches = icmp eq i32 %1, %235  br i1 %matches, label %catch, label %eh.resume36 37catch:38  %3 = extractvalue { ptr, i32 } %0, 039  %4 = tail call ptr @__cxa_begin_catch(ptr %3)40  %5 = load i32, ptr %4, align 441  %cmp = icmp ne i32 %5, 4242  %cond = zext i1 %cmp to i3243  tail call void @__cxa_end_catch()44  br label %return45 46return:47  %retval.0 = phi i32 [ %cond, %catch ], [ 2, %entry ]48  ret i32 %retval.049 50eh.resume:51  resume { ptr, i32 } %052}53