[lld] 1aeb4c4 - [lld][WebAssebmly] Convert tests to use disassembly. NFC

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 10:35:06 PDT 2021


Author: Sam Clegg
Date: 2021-10-27T10:34:52-07:00
New Revision: 1aeb4c4a4324b2d5dd6bfaca85413a82f9724c25

URL: https://github.com/llvm/llvm-project/commit/1aeb4c4a4324b2d5dd6bfaca85413a82f9724c25
DIFF: https://github.com/llvm/llvm-project/commit/1aeb4c4a4324b2d5dd6bfaca85413a82f9724c25.diff

LOG: [lld][WebAssebmly] Convert tests to use disassembly. NFC

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

Added: 
    

Modified: 
    lld/test/wasm/tls.s

Removed: 
    


################################################################################
diff  --git a/lld/test/wasm/tls.s b/lld/test/wasm/tls.s
index 9675b7839aa9b..482d303dbc149 100644
--- a/lld/test/wasm/tls.s
+++ b/lld/test/wasm/tls.s
@@ -74,11 +74,13 @@ tls3:
 
 # RUN: wasm-ld -no-gc-sections --shared-memory --max-memory=131072 --no-entry -o %t.wasm %t.o
 # RUN: obj2yaml %t.wasm | FileCheck %s
+# RUN: llvm-objdump -d --no-show-raw-insn --no-leading-addr %t.wasm | FileCheck --check-prefix=ASM %s --
 
 # RUN: wasm-ld -no-gc-sections --shared-memory --max-memory=131072 --no-merge-data-segments --no-entry -o %t2.wasm %t.o
 # RUN: obj2yaml %t2.wasm | FileCheck %s
 
 # CHECK:      - Type:            GLOBAL
+# __stack_pointer
 # CHECK-NEXT:   Globals:
 # CHECK-NEXT:     - Index:           0
 # CHECK-NEXT:       Type:            I32
@@ -112,60 +114,41 @@ tls3:
 # CHECK-NEXT:         Value:           4
 
 
-# CHECK:      - Type:            CODE
-# CHECK-NEXT:   Functions:
-# Skip __wasm_call_ctors
-# CHECK:          - Index:           1
-# CHECK-NEXT:       Locals:          []
-# CHECK-NEXT:       Body:            2000240120004100410CFC0800000B
-
-# Expected body of __wasm_init_tls:
-#   local.get 0
-#   global.set  1
-#   local.get 0
-#   i32.const 0
-#   i32.const 12
-#   memory.init 1, 0
-#   end
-
-# CHECK-NEXT:     - Index:           2
-# CHECK-NEXT:       Locals:          []
-# CHECK-NEXT:       Body:            2381808080004180808080006A0B
-
-# Expected body of tls1_addr:
-#   global.get 1
-#   i32.const 0
-#   i32.add
-#   end
-
-# CHECK-NEXT:     - Index:           3
-# CHECK-NEXT:       Locals:          []
-# CHECK-NEXT:       Body:            2381808080004184808080006A0B
-
-# Expected body of tls2_addr:
-#   global.get 1
-#   i32.const 4
-#   i32.add
-#   end
-
-# CHECK-NEXT:     - Index:           4
-# CHECK-NEXT:       Locals:          []
-# CHECK-NEXT:       Body:            2381808080004188808080006A0B
-
-# Expected body of tls3_addr:
-#   global.get 1
-#   i32.const 4
-#   i32.add
-#   end
-
-# CHECK-NEXT:     - Index:           5
-# CHECK-NEXT:       Locals:          []
-# CHECK-NEXT:       Body:            2383808080000B
-
-# Expected body of tls_align:
-#   global.get 3
-#   end
-
+# ASM:      <__wasm_init_tls>:
+# ASM-EMPTY:
+# ASM-NEXT:   local.get 0
+# ASM-NEXT:   global.set 1
+# ASM-NEXT:   local.get 0
+# ASM-NEXT:   i32.const 0
+# ASM-NEXT:   i32.const 12
+# ASM-NEXT:   memory.init 0, 0
+# ASM-NEXT:   end
+
+# ASM:      <tls1_addr>:
+# ASM-EMPTY:
+# ASM-NEXT:   global.get 1
+# ASM-NEXT:   i32.const 0
+# ASM-NEXT:   i32.add
+# ASM-NEXT:   end
+
+# ASM:      <tls2_addr>:
+# ASM-EMPTY:
+# ASM-NEXT:   global.get 1
+# ASM-NEXT:   i32.const 4
+# ASM-NEXT:   i32.add
+# ASM-NEXT:   end
+
+# ASM:      <tls3_addr>:
+# ASM-EMPTY:
+# ASM-NEXT:   global.get 1
+# ASM-NEXT:   i32.const 8
+# ASM-NEXT:   i32.add
+# ASM-NEXT:   end
+
+# ASM:      <tls_align>:
+# ASM-EMPTY:
+# ASM-NEXT:  global.get 3
+# ASM-NEXT:  end
 
 # Also verify TLS usage with --relocatable
 # RUN: wasm-ld --relocatable -o %t3.wasm %t.o


        


More information about the llvm-commits mailing list