-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update test cases to LLVM 9.0 #105
Comments
This comment has been minimized.
This comment has been minimized.
Note, we still have to update golden test cases, that is the expected output of llir/llvm (since comments are ignored and whitespace may differ). Updates llir/llvm#105.
Note, to update the test cases from LLVM 7.0 to LLVM 9.0, the following steps were taken. Update VER in testdata/llvm/Makefile: # LLVM version.
-VER=7.0.0
+VER=9.0.0 Run From the make Run skip.sh to skip a few "bad" test cases. ./skip.sh Commit new test cases to the Git repo.
The remaining step is to update the Each test case (e.g. llvm/test/Analysis/DominanceFrontier/new_pm_test.ll) has a corresponding golden output (e.g. llvm/test/Analysis/DominanceFrontier/new_pm_test.ll.golden), since the input may differ from the expected output (in the golden output comments are removed and whitespace may change as compared to the input). Sometimes the expected output changes when the grammar of LLVM IR is updated in between LLVM releases. Otherwise the expected output should remain stable. Once the test cases are commited, we enter an iterative process of updating the LLVM IR grammar to incorporate new changes made to the LLVM IR language as part of the release, and then if new concepts are added to the language, then add the respective concepts to |
…t.ll.golden Updates llir/llvm#104. Updates llir/llvm#105.
Add `partition` language concept. Updates llir/llvm#105.
…t loose precision Updates llir/llvm#105.
The only test case currently failing is !7 = !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_signed) Results from
|
@dannypsnl, feel like taking a look at adding the enums needed to help the parser handle this line? (I think it is !7 = !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_signed) |
I dig into this case, the parser returns error: https://github.com/llir/grammar/blob/f1eb80e86b542bd8a463371e8a99e116c61d2364/ll.tm#L107 UpdateI think I got the point, but how to generate enum? |
By the way, would you like to use official IR Parser by submodule LLVM-IR-parser and mapping ast only? textmapper didn't provide a reasonable result for parsing error. I didn't know which step it stuck. All I got was: Here is the test code: package asm
import (
"testing"
"github.com/llir/ll/ast"
)
func TestParse(t *testing.T) {
testCode := `!7 = !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_signed)`
_, err := ast.Parse("", testCode)
if err != nil {
t.Error(err)
}
} |
Hi @dannypsnl! Great that you started working on this! The test case you wrote is good. Unfortunately Textmapper does not show column, but only line offset of errors. I'll submit an issue upstream. One thing you could do for now to get more useful errors is to split the line into multiple lines (since whitespace tokens are ignored): !7
=
!DIExpression(DW_OP_LLVM_convert,
16,
DW_ATE_unsigned,
DW_OP_LLVM_convert,
32,
DW_ATE_signed
) Now, we get the error at "line 5". $ go test -v
=== RUN TestParse
TestParse: aaa_test.go:18: syntax error at line 5 Which corresponds to this line: DW_ATE_unsigned, So, we now know it fails to parse Dwarf Attribute Encodings in An update was made to To see the diff, run: diff -u llvm-7.0.0.src/lib/AsmParser/ llvm-9.0.0.src/lib/AsmParser/ The relevant part for this change is in + if (Lex.getKind() == lltok::DwarfAttEncoding) {
+ if (unsigned Op = dwarf::getAttributeEncoding(Lex.getStrVal())) {
+ Lex.Lex();
+ Elements.push_back(Op);
+ continue;
+ }
+ return TokError(Twine("invalid DWARF attribute encoding '") + Lex.getStrVal() + "'");
+ }
+ So, the From:
To:
|
Introduced in LLVM 9.0. Updates llir/llvm#101. ref: llir/llvm#105 (comment)
The grammar has now been updated llir/grammar@7cadd4c Edit: so now the test case you provided works, the input LLVM IR is successfully parsed into its AST representation:
|
This includes the DW_OP_LLVM_convert and DW_OP_LLVM_tag_offset enums of LLVM 9.0, and the use of Dwarf Attribute Encoding in DIExpression (e.g. DW_ATE_unsigned). Updates llir/llvm#105.
* (#105) add enum: DW_OP_LLVM_convert ``` go generate ./... cd asm/enum && make ``` issue: still can't fix the bug #105 (comment) * (#105) add enums DW_OP_LLVM_tag_offset = 0x1002 DW_OP_GNU_entry_value = 0xf3 * (#105) fix goimports version to correct imports
Fixed by @dannypsnl in #110. |
Reported upstream at inspirer/textmapper#36 |
This was done by following the steps outlined in #132 and llir/llvm#105 (comment)
* llvm: update test cases to LLVM 11.0 release This was done by following the steps outlined in #132 and llir/llvm#105 (comment) * llvm: update golden test cases to LLVM 11.0 Updates llir/llvm#158.
Some of the previously valid test cases (taken from the 7.0 release of LLVM) are no longer valid.
Error reported by
opt
of the LLVM 9.0 release when parsing testdata/llvm/test/Analysis/DominanceFrontier/new_pm_test.ll:$ opt -S -o foo.ll new_pm_test.ll opt: new_pm_test.ll:29:1: error: label expected to be numbered '12' 13: ^
Error reported by
go test
forllir/llvm
once updated to handle explicitly named unnamed basic blocks (as done in LLVM 9.0); see #104.From https://travis-ci.org/llir/llvm/jobs/605020808#L708:
The text was updated successfully, but these errors were encountered: