-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DWARFv5] Allow ".loc 0" to refer to the root file.
DWARF v5 explicitly represents file #0 in the line table. Prior versions did not, so ".loc 0" is still an error in those cases. Differential Revision: https://reviews.llvm.org/D48452 llvm-svn: 335350
- Loading branch information
Showing
4 changed files
with
35 additions
and
4 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
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,26 @@ | ||
# RUN: llvm-mc -dwarf-version 5 %s -filetype=obj -o - | llvm-dwarfdump -debug-line - | FileCheck %s | ||
# RUN: not llvm-mc -dwarf-version 4 %s -filetype=asm -o - 2>&1 | FileCheck %s -check-prefix=ERR | ||
# REQUIRES: default_triple | ||
# Darwin line table is stuck on DWARF v2. | ||
# XFAIL: darwin | ||
# Show that ".loc 0" works in DWARF v5, gets an error for earlier versions. | ||
.file 0 "root.cpp" | ||
.file 1 "header.h" | ||
.loc 0 10 0 | ||
nop | ||
.loc 1 20 0 | ||
nop | ||
|
||
# CHECK: file_names[ 0]: | ||
# CHECK-NEXT: name: "root.cpp" | ||
# CHECK: file_names[ 1]: | ||
# CHECK-NEXT: name: "header.h" | ||
# CHECK: Address Line Column File | ||
# CHECK-NEXT: ------- | ||
# CHECK-NEXT: 0x{{0+}}0 10 0 0 | ||
# CHECK-NEXT: 0x{{0+}}1 20 0 1 | ||
# CHECK-NEXT: 0x{{0+}}2 20 0 1 {{.*}} end_sequence | ||
|
||
# ERR: file number less than one in '.loc' directive | ||
# ERR-NEXT: .loc 0 10 0 | ||
# ERR-NEXT: ^ |