brintos

brintos / llvm-project-archived public Read only

0
0
Text · 922 B · 9a10276 Raw
35 lines · plain
1;; This is a minimal reproducer that caused StackProtector to crash with a bad cast when2;; CrossDSOCFI is used. This test just needs to not crash.3; REQUIRES: x86-registered-target4; RUN: opt -mtriple=x86_64-pc-linux-gnu %s -passes=lowertypetests,cross-dso-cfi,stack-protector5 6define hidden void @__stack_chk_fail() !type !1{7  unreachable8}9 10define void @store_captures() sspstrong {11entry:12  %a = alloca i32, align 413  %j = alloca ptr, align 814  store ptr %a, ptr %j, align 815  ret void16}17 18define void @func(ptr %0) {19entry:20  %1 = call i1 @llvm.type.test(ptr %0, metadata !"typeid")21  br i1 %1, label %cont, label %trap22 23trap:                                             ; preds = %entry24  call void @llvm.trap()25  unreachable26 27cont:                                             ; preds = %entry28  call void %0()29  ret void30}31 32!llvm.module.flags = !{!0}33!0 = !{i32 4, !"Cross-DSO CFI", i32 1}34!1 = !{i64 0, !"typeid"}35