summaryrefslogtreecommitdiff
path: root/lld/test/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/wasm')
-rw-r--r--lld/test/wasm/libsearch.s5
-rw-r--r--lld/test/wasm/lto/cache-warnings.ll12
-rw-r--r--lld/test/wasm/reproduce.s3
3 files changed, 14 insertions, 6 deletions
diff --git a/lld/test/wasm/libsearch.s b/lld/test/wasm/libsearch.s
index 23336510748c..20f1e9b2bfa3 100644
--- a/lld/test/wasm/libsearch.s
+++ b/lld/test/wasm/libsearch.s
@@ -93,6 +93,11 @@
// RUN: wasm-ld -pie --experimental-pic --emit-relocs --no-gc-sections -o %t3 %t.o -L%t.dir -Bstatic -call_shared -lls
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s
+/// -r implies -Bstatic and has precedence over -Bdynamic.
+// RUN: wasm-ld -r -Bdynamic %t.o -L%t.dir -lls -o %t3.ro
+// RUN: llvm-readobj -s -h %t3.ro | FileCheck --check-prefix=RELOCATABLE %s
+// RELOCATABLE: Name: _static
+
.globl _start, _bar
_start:
.functype _start () -> ()
diff --git a/lld/test/wasm/lto/cache-warnings.ll b/lld/test/wasm/lto/cache-warnings.ll
index 9175fc97a075..c21093b533c7 100644
--- a/lld/test/wasm/lto/cache-warnings.ll
+++ b/lld/test/wasm/lto/cache-warnings.ll
@@ -1,5 +1,3 @@
-; REQUIRES: shell
-
; RUN: opt -module-hash -module-summary %s -o %t.o
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o
@@ -20,13 +18,17 @@
;; Get the total size of created cache files.
; RUN: rm -rf %t && mkdir %t && cd %t
; RUN: wasm-ld --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=32k %t2.o %t.o -o %t3 2>&1
-; RUN: %python -c "import os, sys; print(sum(os.path.getsize(filename) for filename in os.listdir('.') if os.path.isfile(filename) and filename.startswith('llvmcache-')))" > %t.size.txt
+; RUN: %python -c "import os, sys; size=sum(os.path.getsize(filename) for filename in os.listdir('.') if os.path.isfile(filename) and filename.startswith('llvmcache-')); print(size+5); print(size-5)" > %t.size.txt
;; Case 2: If the total size of the cache files created by the current link job is less than the maximum size for the cache directory in bytes, there is no warning.
-; RUN: wasm-ld --verbose --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=$(($(cat %t.size.txt) + 5)) %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:
+; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response
+; RUN: head -1 %t.size.txt >> %t.response
+; RUN: wasm-ld --verbose --thinlto-cache-dir=%t @%t.response %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:
;; Case 3: If the total size of the cache files created by the current link job exceeds the maximum size for the cache directory in bytes, a warning is given.
-; RUN: wasm-ld --verbose --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=$(($(cat %t.size.txt) - 5)) %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=SIZE,WARN
+; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response
+; RUN: tail -1 %t.size.txt >> %t.response
+; RUN: wasm-ld --verbose --thinlto-cache-dir=%t @%t.response %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=SIZE,WARN
;; Check emit two warnings if pruning happens due to reach both the size and number limits.
; RUN: wasm-ld --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_files=1:cache_size_bytes=1 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=NUM,SIZE,WARN
diff --git a/lld/test/wasm/reproduce.s b/lld/test/wasm/reproduce.s
index a89843fe219e..40e9ad3794d5 100644
--- a/lld/test/wasm/reproduce.s
+++ b/lld/test/wasm/reproduce.s
@@ -1,4 +1,5 @@
-# REQUIRES: shell
+# Unsupported on Windows due to maximum path length limitations.
+# UNSUPPORTED: system-windows
# RUN: rm -rf %t.dir
# RUN: mkdir -p %t.dir
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.dir/foo.o %s