brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · c9978d6 Raw
77 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s --check-prefix=X642; RUN: llc -mtriple=i386-unknown-unknown < %s | FileCheck %s   --check-prefix=X863 4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5;; foo6;; -----7;; Checks ENDBR insertion after return twice functions.8;; setjmp, sigsetjmp, savectx, vfork, getcontext9;; setzx is not return twice function, should not followed by endbr.10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11 12; X64:           callq   setjmp13; X64-NEXT:      endbr6414; X64:           callq   setzx15; X64-NEXT:      xorl16; X64:           callq   sigsetjmp17; X64-NEXT:      endbr6418; X64:           callq   savectx19; X64-NEXT:      endbr6420; X64:           callq   vfork21; X64-NEXT:      endbr6422; X64:           callq   getcontext23; X64-NEXT:      endbr6424 25; X86:           calll   setjmp26; X86-NEXT:      endbr3227; X86:           calll   setzx28; X86-NEXT:      xorl29; X86:           calll   sigsetjmp30; X86-NEXT:      endbr3231; X86:           calll   savectx32; X86-NEXT:      endbr3233; X86:           calll   vfork34; X86-NEXT:      endbr3235; X86:           calll   getcontext36; X86-NEXT:      endbr3237 38; Function Attrs: noinline nounwind optnone uwtable39define dso_local void @foo() #0 {40entry:41  %call = call i32 (i32, ...) @setjmp(i32 0) #142  %call1 = call i32 (i32, ...) @setzx(i32 0)43  %call2 = call i32 (i32, ...) @sigsetjmp(i32 0) #144  %call3 = call i32 (i32, ...) @setzx(i32 0)45  %call4 = call i32 (i32, ...) @savectx(i32 0) #146  %call5 = call i32 @vfork() #147  %call6 = call i32 (i32, ...) @setzx(i32 0)48  %call7 = call i32 (i32, ...) @getcontext(i32 0) #149  ret void50}51 52; Function Attrs: returns_twice53declare dso_local i32 @setjmp(...) #154 55declare dso_local i32 @setzx(...)56 57; Function Attrs: returns_twice58declare dso_local i32 @sigsetjmp(...) #159 60; Function Attrs: returns_twice61declare dso_local i32 @savectx(...) #162 63; Function Attrs: returns_twice64declare dso_local i32 @vfork() #165 66; Function Attrs: returns_twice67declare dso_local i32 @getcontext(...) #168 69attributes #0 = { noinline nounwind optnone uwtable }70attributes #1 = { returns_twice }71 72!llvm.module.flags = !{!0, !1, !2}73 74!0 = !{i32 1, !"wchar_size", i32 4}75!1 = !{i32 8, !"cf-protection-return", i32 1}76!2 = !{i32 8, !"cf-protection-branch", i32 1}77