[llvm] dc9854d - [JITLink] Fix check-line in Windows X86 COFF COMDAT test

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 07:07:44 PDT 2022


Author: Stefan Gränitz
Date: 2022-11-03T15:07:20+01:00
New Revision: dc9854d4e91e5ede86e8ebb9bfea244cf494e8c6

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

LOG: [JITLink] Fix check-line in Windows X86 COFF COMDAT test

This test caught my attention because it's the only one in JITLink that XFAILs. Running it in isolation showed that the output doesn't meet the CHECK-LINES, i.e. the block address didn't match:

```
error: CHECK-NEXT: expected string not found in input
  CHECK-NEXT: block 0xfff02000 size = 0x00000001, align = 16, alignment-offset = 0

<stdin>:22:2: note: possible intended match here
              block 0xfff01000 size = 0x00000001, align = 16, alignment-offset = 0
```

Though, that doesn't appear to be the reason the test XFAILs. What we really want to check here is that llvm-jitlink doesn't fail with a duplicate section error yet.
In order to avoid issues like this in the future we can match a placeholder to check for some valid address within the slab (64Kb == last 4 digits).

The patch also drops the duplicate -noexec argument, removes an empty RUN-line, fixes indentation and adds a newline at EOF.

Reviewed By: sunho

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

Added: 
    

Modified: 
    llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak_plus_strong.s

Removed: 
    


################################################################################
diff  --git a/llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak_plus_strong.s b/llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak_plus_strong.s
index 30e0193b11a65..2754855e428e0 100644
--- a/llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak_plus_strong.s
+++ b/llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak_plus_strong.s
@@ -1,22 +1,23 @@
 # FIXME: Comdat any + ordinary strong symbol should generate duplicate section error
 # XFAIL: *
+#
 # RUN: rm -rf %t && mkdir -p %t
 # RUN: yaml2obj %S/Inputs/COFF_comdat_weak_def.yaml -o %t/COFF_weak_1.o
 # RUN: yaml2obj %S/Inputs/COFF_strong_def.yaml -o %t/COFF_strong.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t/COFF_main.o
-# RUN: 
+#
 # RUN: not llvm-jitlink -noexec %t/COFF_main.o %t/COFF_weak_1.o %t/COFF_strong.o \
-# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
-# RUN: -show-graph -noexec 2>&1 | FileCheck %s
+# RUN:                  -slab-allocate 64Kb -slab-address 0xfff00000 \
+# RUN:                  -slab-page-size 4096 -show-graph 2>&1 | FileCheck %s
 #
-# Check that a combination of comdat any definition and strong definition generate 
-# duplicate definition error.
+# Check that a combination of comdat any definition and strong definition
+# generate duplicate definition error.
 #
 # CHECK: section strongfunc:
 # CHECK-EMPTY:
-# CHECK-NEXT:  block 0xfff02000 size = 0x00000001, align = 16, alignment-offset = 0
+# CHECK-NEXT:  block 0xfff0[[LO:[0-9a-f]+]] size = 0x00000001, align = 16, alignment-offset = 0
 # CHECK-NEXT:    symbols:
-# CHECK-NEXT:      0xfff02000 (block + 0x00000000): size: 0x00000001, linkage: strong, scope: default, live  -   func
+# CHECK-NEXT:      0xfff0[[LO]] (block + 0x00000000): size: 0x00000001, linkage: strong, scope: default, live  -   func
 # CHECK-NEXT:    no edges
 
 	.text
@@ -28,5 +29,5 @@
 	.globl	main
 	.p2align	4, 0x90
 main:
-    callq func
-	retq
\ No newline at end of file
+	callq func
+	retq


        


More information about the llvm-commits mailing list