[lld] r362650 - [WebAssembly] Improve lto/comdat.ll test. NFC.

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 14:08:30 PDT 2019


Author: sbc
Date: Wed Jun  5 14:08:30 2019
New Revision: 362650

URL: http://llvm.org/viewvc/llvm-project?rev=362650&view=rev
Log:
[WebAssembly] Improve lto/comdat.ll test. NFC.

We were not previously testing the comdat exclusion in bitcode objects
because we were linking two copies of the .bc file and the
`linkonce_odr` linkage type was removing the duplicate `_start` at
the LTO stage.

Now we link an bitcode and non-bitcode version both of which contains a
copy of _start.  We link them in both orders, which means this test will
fail if comdat exclusion is not working correctly in bitcode parsing.

Differential Revision: https://reviews.llvm.org/D62923

Modified:
    lld/trunk/test/wasm/lto/comdat.ll

Modified: lld/trunk/test/wasm/lto/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/wasm/lto/comdat.ll?rev=362650&r1=362649&r2=362650&view=diff
==============================================================================
--- lld/trunk/test/wasm/lto/comdat.ll (original)
+++ lld/trunk/test/wasm/lto/comdat.ll Wed Jun  5 14:08:30 2019
@@ -1,15 +1,17 @@
 ; Verify that comdat symbols can be defined in LTO objects.  We had a
 ; regression where the comdat handling code was causing symbol in the lto object
 ; to be ignored.
-; RUN: llvm-as %s -o %t.o
-; RUN: wasm-ld %t.o %t.o -o %t.wasm
+; RUN: llvm-as %s -o %t.bc
+; RUN: llc -filetype=obj %s -o %t.o
+; RUN: wasm-ld %t.bc %t.o -o %t.wasm
+; RUN: wasm-ld %t.o %t.bc -o %t.wasm
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
 
 $foo = comdat any
 
-define linkonce_odr void @_start() comdat($foo) {
+define void @_start() comdat($foo) {
 entry:
   ret void
 }




More information about the llvm-commits mailing list