brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 56d690a Raw
66 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-linux -mcpu=corei7                             < %s | FileCheck %s2 3; Test invoking of patchpoints4;5define i64 @patchpoint_invoke(i64 %p1, i64 %p2) personality ptr @__gxx_personality_v0 {6entry:7; CHECK-LABEL: patchpoint_invoke:8; CHECK-NEXT:  [[FUNC_BEGIN:.L.*]]:9; CHECK-NEXT: .cfi_startproc10; CHECK:      .cfi_lsda 3, [[EXCEPTION_LABEL:.L[^ ]*]]11; CHECK:      pushq %rbp12 13; Unfortunately, hardcode the name of the label that begins the patchpoint:14; CHECK:      .Ltmp0:15; CHECK:      movabsq $-559038736, %r1116; CHECK-NEXT: callq *%r1117; CHECK-NEXT: xchgw %ax, %ax18; CHECK-NEXT: [[PP_END:.L.*]]:19; CHECK:      ret20  %resolveCall = inttoptr i64 -559038736 to ptr21  %result = invoke i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 2, i32 15, ptr %resolveCall, i32 1, i64 %p1, i64 %p2)22            to label %success unwind label %threw23 24success:25  ret i64 %result26 27threw:28  %0 = landingpad { ptr, i32 }29          catch ptr null30  ret i64 031}32 33; Verify that the exception table was emitted:34; CHECK:      [[EXCEPTION_LABEL]]:35; CHECK-NEXT: .byte 25536; CHECK-NEXT: .byte 337; CHECK-NEXT: .uleb128 .Lttbase{{[0-9]+}}-[[TTBASEREF:.Lttbaseref[0-9]+]]38; CHECK-NEXT: [[TTBASEREF]]:39; CHECK-NEXT: .byte 140; CHECK-NEXT: .uleb128 .Lcst_end{{[0-9]+}}-[[CST_BEGIN:.Lcst_begin[0-9]+]]41; CHECK-NEXT: [[CST_BEGIN]]:42; Verify that the unwind data covers the entire patchpoint region:43; CHECK-NEXT: .uleb128 .Ltmp0-[[FUNC_BEGIN]]44; CHECK-NEXT: .uleb128 [[PP_END]]-.Ltmp045 46 47; Verify that the stackmap section got emitted:48; CHECK-LABEL: __LLVM_StackMaps:49; Header50; CHECK-NEXT:   .byte 351; CHECK-NEXT:   .byte 052; CHECK-NEXT:   .short 053; Num Functions54; CHECK-NEXT:   .long 155; Num LargeConstants56; CHECK-NEXT:   .long 057; Num Callsites58; CHECK-NEXT:   .long 159; CHECK-NEXT:   .quad patchpoint_invoke60 61 62declare void @llvm.experimental.stackmap(i64, i32, ...)63declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)64declare i64 @llvm.experimental.patchpoint.i64(i64, i32, ptr, i32, ...)65declare i32 @__gxx_personality_v0(...)66