aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MC/ELF/cfi-scope-errors.s
blob: c17eadd9ddf6447f66c0471314ceaaab4d57b8a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# RUN: not llvm-mc %s -triple x86_64-linux -o /dev/null 2>&1 | FileCheck %s
# RUN: not llvm-mc %s -triple x86_64-linux -filetype=obj -o /dev/null 2>&1 | FileCheck %s

.text
.cfi_def_cfa rsp, 8
# CHECK: [[#@LINE-1]]:1: error: this directive must appear between .cfi_startproc and .cfi_endproc directives

.cfi_startproc
nop

## This tests source location correctness as well as the error and it not crashing.
# CHECK: [[#@LINE+2]]:1: error: starting new .cfi frame before finishing the previous one
.cfi_startproc

nop
.cfi_endproc

.cfi_def_cfa rsp, 8
# CHECK: [[#@LINE-1]]:1: error: this directive must appear between .cfi_startproc and .cfi_endproc directives

## Check we don't crash on unclosed frame scope.
.globl foo
foo:
 .cfi_startproc
# CHECK: [[#@LINE+1]]:1: error: Unfinished frame!