llir / llvm

Library for interacting with LLVM IR in pure Go.
https://llir.github.io/document/
BSD Zero Clause License
1.19k stars 78 forks source link

update test cases to LLVM 11.0 #158

Closed mewmew closed 3 years ago

mewmew commented 4 years ago

The test cases have been updated to LLVM 11.0, using the same steps as in https://github.com/llir/llvm/issues/132#issue-588625688

Use branch llvm-11.0-testdata of the testdata repository.

These are the currently failing test cases.

Test case mismatch

Note, it is quite likely that a few of the original test cases have been updated. In these cases, we must also update our .golden file of those test cases.

For errors like asm_test.go:531: module "../testdata/llvm/test/Analysis/CostModel/AMDGPU/fdiv.ll.golden" mismatch (-want +got):

See https://github.com/llir/llvm/issues/132#issuecomment-604634673 for example on how to update these kind of test cases.

Fixed in rev llir/testdata@a3f3b7a2aad988afa25ce068721393babd7b3736.

Parse errors

These requires update to the LLVM IR grammar (for inspiration, see #101 for update of grammar to LLVM 9.0)

For errors like asm_test.go:516: unable to parse "../testdata/llvm/test/Transforms/InstSimplify/compare.ll" into AST; syntax error at line 1676:

dannypsnl commented 3 years ago
dannypsnl commented 3 years ago

And

seems stuck by DIModule parsing error, DIModule sysroot cannot be parsed(but it should).

mewmew commented 3 years ago

It seems the sysroot value is not quoted in the output.

Current output of llir/llvm:

!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "LLVM version 3.7.0", runtimeVersion: 2, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !3, sysroot: /)

Should be sysroot: "/" rather than sysroot: /

mewmew commented 3 years ago

This issue has now been resolved, and all LLVM 11.0 test cases are passing. Incredible work @dannypsnl!