forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply [llvm-ar] Include a line number when failing to parse an MRI …
…script Reapply r372309 Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372374 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Owen Reynolds
committed
Sep 20, 2019
1 parent
8958b8b
commit 86279ff
Showing
6 changed files
with
62 additions
and
8 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
; RUN: echo abc > %t.mri | ||
|
||
; RUN: not llvm-ar -M < %t.mri 2>&1 | FileCheck %s | ||
; CHECK: error: unknown command: abc | ||
; CHECK: error: script line 1: unknown command: abc |
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,41 @@ | ||
## Test different MRI comment formats and whitespace. | ||
|
||
# RUN: rm -rf %t && mkdir -p %t | ||
|
||
# RUN: echo "create %t/mri.ar" > %t/script1.mri | ||
# RUN: echo "addlib %t/missing.a" >> %t/script1.mri | ||
|
||
# RUN: not llvm-ar -M < %t/script1.mri 2>&1 | FileCheck --check-prefix=SCRIPT1 %s | ||
# SCRIPT1: error: script line 2: could not open library | ||
|
||
# RUN: echo "create %t/mri.ar" > %t/script2.mri | ||
# RUN: echo "addlib %t/bad.a" >> %t/script2.mri | ||
|
||
# RUN: echo "bad archive" > %t/bad.a | ||
|
||
# RUN: not llvm-ar -M < %t/script2.mri 2>&1 | FileCheck --check-prefix=SCRIPT2 %s | ||
# SCRIPT2: error: script line 2: could not parse library | ||
|
||
# RUN: echo "create %t/mri.ar" > %t/script3.mri | ||
# RUN: echo "create %t/second.ar" >> %t/script3.mri | ||
|
||
# RUN: not llvm-ar -M < %t/script3.mri 2>&1 | FileCheck --check-prefix=SCRIPT3 %s | ||
# SCRIPT3: error: script line 2: editing multiple archives not supported | ||
|
||
# RUN: echo "save" > %t/script4.mri | ||
# RUN: echo "create %t/mri.ar" >> %t/script4.mri | ||
|
||
# RUN: not llvm-ar -M < %t/script4.mri 2>&1 | FileCheck --check-prefix=SCRIPT4 %s | ||
# SCRIPT4: error: script line 2: file already saved | ||
|
||
# RUN: echo "create %t/mri.ar" > %t/script5.mri | ||
# RUN: echo "bad command" >> %t/script5.mri | ||
|
||
# RUN: not llvm-ar -M < %t/script5.mri 2>&1 | FileCheck --check-prefix=SCRIPT5 %s | ||
# SCRIPT5: error: script line 2: unknown command: bad | ||
|
||
# RUN: echo "bad command" | not llvm-ar -M 2>&1 | FileCheck --check-prefix=SCRIPT6 %s | ||
# SCRIPT6: error: script line 1: unknown command: bad | ||
|
||
# RUN: not llvm-ar -M rc %t/mri.ar 2>&1 | FileCheck --check-prefix=SCRIPT7 %s | ||
# SCRIPT7: error: cannot mix -M and other options |
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