xref: /llvm-project/bolt/test/X86/tailcall-traps.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1## Tests the peephole that adds trap instructions following indirect tail calls.
2
3RUN: %clang %cflags %p/Inputs/tailcall_traps.s -o %t.exe
4RUN: llvm-bolt %t.exe -o %t --peepholes=tailcall-traps \
5RUN:   --print-peepholes --funcs=foo,bar 2>&1 | FileCheck %s
6
7CHECK:  Binary Function "foo"
8CHECK:    jmpl     *%rax # TAILCALL
9CHECK:    ud2
10CHECK:  End of Function "foo"
11
12CHECK:  Binary Function "bar"
13CHECK:    jmp     moo # TAILCALL
14CHECK:  End of Function "bar"
15