[lld] [LLD][NFC] Don't use x64 import library for x86 target in safeseh-md tests. (PR #102736)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 10 02:18:16 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld-coff

Author: Jacek Caban (cjacek)

<details>
<summary>Changes</summary>

Use llvm-lib to generate input library instead of a binary blob.

There is a mismatch between link target and importlib machine type in the test. This currently works because LLD ignores importlib machine type. I intend to change that, which would cause the test to fail.

---
Full diff: https://github.com/llvm/llvm-project/pull/102736.diff


2 Files Affected:

- (removed) lld/test/COFF/Inputs/except_handler3.lib () 
- (modified) lld/test/COFF/safeseh-md.s (+10-2) 


``````````diff
diff --git a/lld/test/COFF/Inputs/except_handler3.lib b/lld/test/COFF/Inputs/except_handler3.lib
deleted file mode 100644
index fdc51ed7328555..00000000000000
Binary files a/lld/test/COFF/Inputs/except_handler3.lib and /dev/null differ
diff --git a/lld/test/COFF/safeseh-md.s b/lld/test/COFF/safeseh-md.s
index d065af872b8f90..fda09fda64ede4 100644
--- a/lld/test/COFF/safeseh-md.s
+++ b/lld/test/COFF/safeseh-md.s
@@ -1,12 +1,15 @@
 # REQUIRES: x86
-# RUN: llvm-mc -triple i686-windows-msvc %s -filetype=obj -o %t.obj
-# RUN: lld-link %t.obj %S/Inputs/except_handler3.lib -safeseh -out:%t.exe -opt:noref -entry:main
+# RUN: split-file %s %t.dir
+# RUN: llvm-mc -triple i686-windows-msvc %t.dir/safeseh-md.s -filetype=obj -o %t.obj
+# RUN: llvm-lib -machine:x86 -out:%t.dir/except_handler3.lib -def:%t.dir/except_handler3.def
+# RUN: lld-link %t.obj %t.dir/except_handler3.lib -safeseh -out:%t.exe -opt:noref -entry:main
 # RUN: llvm-readobj --coff-load-config %t.exe | FileCheck %s
 
 # CHECK: SEHTable [
 # CHECK-NEXT: 0x
 # CHECK-NEXT: ]
 
+#--- safeseh-md.s
         .def     @feat.00;
         .scl    3;
         .type   0;
@@ -33,3 +36,8 @@ __load_config_used:
         .fill 60, 1, 0
         .long ___safe_se_handler_table
         .long ___safe_se_handler_count
+
+#--- except_handler3.def
+NAME except_handler3.dll
+EXPORTS
+        _except_handler3

``````````

</details>


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


More information about the llvm-commits mailing list