[lld] [lld][WebAssembly] Fix bitcode LTO order in archive parsing (PR #73095)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 12:27:11 PST 2023


================
@@ -0,0 +1,42 @@
+target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+; Generated from this C++ code:
+;
+; int foo();
+; inline int unused = foo();
+;
+; int main() {
+;   return foo();
+; }
----------------
aheejin wrote:

> I wonder if its possible to reduce these test files something smaller by hand writing them instead?
> 
> I'd always prefer something more concise in the test files in possible.

It was generated from that C++ code but hand-simplified later to delete some unnecessary parts. I think I can delete some more, but the overall structure is still the same. (That `@llvm.global_ctors` is still necessary; without this the error does not occur.) I think I can delete this comment.

> Also, I wonder if we even need to mention `global_var_init` .. presumably this problem applies to all comat groups? Should we call these something `comdat_ordering.ll`?

I don't think this problem is specific to `global_var_init`, but that all bug reports we got contained it kind of makes me think that the condition this bug is triggered is mostly created by `global_var_init`. I think I can rename the tests, but I guess it is fine to leave the variables in the tests as `__cxx_global_var_init`.

https://github.com/llvm/llvm-project/pull/73095


More information about the llvm-commits mailing list