xref: /llvm-project/llvm/test/MC/ELF/cfi-scope-errors.s (revision 8c85aae6c5b282eee1f58e67334e809016f04776)
1*8c85aae6SFangrui Song# RUN: not llvm-mc %s -triple x86_64-linux -o /dev/null 2>&1 | FileCheck %s
2*8c85aae6SFangrui Song# RUN: not llvm-mc %s -triple x86_64-linux -filetype=obj -o /dev/null 2>&1 | FileCheck %s
3*8c85aae6SFangrui Song
4*8c85aae6SFangrui Song.text
5*8c85aae6SFangrui Song.cfi_def_cfa rsp, 8
6*8c85aae6SFangrui Song# CHECK: [[#@LINE-1]]:1: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
7*8c85aae6SFangrui Song
8*8c85aae6SFangrui Song.cfi_startproc
9*8c85aae6SFangrui Songnop
10*8c85aae6SFangrui Song
11*8c85aae6SFangrui Song## This tests source location correctness as well as the error and it not crashing.
12*8c85aae6SFangrui Song# CHECK: [[#@LINE+2]]:1: error: starting new .cfi frame before finishing the previous one
13*8c85aae6SFangrui Song.cfi_startproc
14*8c85aae6SFangrui Song
15*8c85aae6SFangrui Songnop
16*8c85aae6SFangrui Song.cfi_endproc
17*8c85aae6SFangrui Song
18*8c85aae6SFangrui Song.cfi_def_cfa rsp, 8
19*8c85aae6SFangrui Song# CHECK: [[#@LINE-1]]:1: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
20*8c85aae6SFangrui Song
21*8c85aae6SFangrui Song## Check we don't crash on unclosed frame scope.
22*8c85aae6SFangrui Song.globl foo
23*8c85aae6SFangrui Songfoo:
24*8c85aae6SFangrui Song .cfi_startproc
25*8c85aae6SFangrui Song# CHECK: [[#@LINE+1]]:1: error: Unfinished frame!
26