-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLVM][AsmParser] Add support for C style comments (#111554)
Add support for C style comments in LLVM assembly. --------- Co-authored-by: Nikita Popov <[email protected]>
- Loading branch information
Showing
8 changed files
with
80 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
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,22 @@ | ||
; RUN: llvm-as < %s | llvm-dis | FileCheck %s | ||
|
||
/* Simple C style comment */ | ||
|
||
; CHECK: @B = external global i32 | ||
@B = external global i32 | ||
|
||
/* multiline C ctyle comment at "top-level" | ||
* This is the second line | ||
* and this is third | ||
*/ | ||
|
||
|
||
; CHECK: @foo | ||
define <4 x i1> @foo(<4 x float> %a, <4 x float> %b) nounwind { | ||
entry: /* inline comment */ | ||
%cmp = fcmp olt <4 x float> %a, /* to be ignored */ %b | ||
ret <4 x i1> %cmp /* ignore */ | ||
} | ||
|
||
/* End of the assembly file */ | ||
|
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,6 @@ | ||
; RUN: not llvm-as --disable-output %s 2>&1 | FileCheck %s -DFILE=%s | ||
|
||
@B = external global i32 | ||
|
||
; CHECK: [[FILE]]:[[@LINE+1]]:1: error: unterminated comment | ||
/* End of the assembly file |
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,8 @@ | ||
; RUN: not llvm-as --disable-output %s 2>&1 | FileCheck %s -DFILE=%s | ||
|
||
@B = external global i32 | ||
|
||
/* /* Nested comments not supported */ | ||
|
||
; CHECK: [[FILE]]:[[@LINE+1]]:1: error: redefinition of global '@B' | ||
@B = external global i32 |
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,7 @@ | ||
; RUN: not llvm-as --disable-output %s 2>&1 | FileCheck %s -DFILE=%s | ||
|
||
@B = external global i32 | ||
|
||
; CHECK: [[FILE]]:[[@LINE+1]]:2: error: expected top-level entity | ||
*/ | ||
|
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,6 @@ | ||
; RUN: not llvm-as --disable-output %s 2>&1 | FileCheck %s -DFILE=%s | ||
|
||
@B = external global i32 | ||
|
||
; CHECK: [[FILE]]:[[@LINE+1]]:1: error: unterminated comment | ||
/* End of the assembly file * |