-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[MC][AsmParser] Diagnose improperly nested .cfi frames"
This showed up when simplifying some large testcase, where the cfi directives became out of sync with the proc's they enclose. Now restricted to platforms that support .subsections_via_symbols. This reverts commit 797b68c. Fixes: #72802 Differential revision: https://reviews.llvm.org/D153167 rdar://111459507
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; RUN: not llvm-mc -triple arm64-apple-darwin %s -filetype=obj -o /dev/null 2>&1 | FileCheck %s --check-prefix=DARWIN | ||
|
||
; REQUIRES: aarch64-registered-target | ||
|
||
.section __TEXT,locomotive,regular,pure_instructions | ||
|
||
.globl _locomotive | ||
.p2align 2 | ||
_locomotive: | ||
.cfi_startproc | ||
ret | ||
|
||
; It is invalid to have a non-private label between .cfi_startproc and | ||
; .cfi_endproc on MachO platforms. | ||
.section __TEXT,__text,regular,pure_instructions | ||
.globl _caboose | ||
.p2align 2 | ||
_caboose: | ||
; DARWIN: [[#@LINE-1]]:1: error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs | ||
; DARWIN: [[#@LINE-10]]:2: error: previous .cfi_startproc was here | ||
ret | ||
.cfi_endproc | ||
|
||
.subsections_via_symbols |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# RUN: llvm-mc -triple arm64-pc-linux-gnu %s -filetype=obj -o /dev/null 2>&1 | FileCheck %s --allow-empty --check-prefix=ELF | ||
# RUN: llvm-mc -triple arm64-windows-gnu %s -filetype=obj -o /dev/null 2>&1 | FileCheck %s --allow-empty --check-prefix=ELF | ||
|
||
# REQUIRES: aarch64-registered-target | ||
|
||
.globl _locomotive | ||
.p2align 2 | ||
_locomotive: | ||
.cfi_startproc | ||
ret | ||
|
||
.globl _caboose | ||
.p2align 2 | ||
_caboose: | ||
ret | ||
.cfi_endproc | ||
|
||
# Check that the diagnostic does not fire on ELF, nor COFF platforms, which do | ||
# not support subsections_via_symbols. See also: cfi-bad-nesting-darwin.s | ||
# ELF-NOT: error: |