[llvm] [Cygwin] Fix global variable dll import (PR #121439)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 01:44:14 PST 2025


mstorsjo wrote:

> Thank you. I'm really not familiar with adding tests. If @mati865 has a larger plan including this patch, I think it's also OK. I just wanted to solve the problem.

We generally require test additions to go along with the functional changes, unless there's a good reason not to, or there is a high urgency to unbreak things.

For this case, just add this change to your patch:
```diff
diff --git a/llvm/test/CodeGen/X86/mingw-refptr.ll b/llvm/test/CodeGen/X86/mingw-refptr.ll
index 73f1a9880913..82a90aba3865 100644
--- a/llvm/test/CodeGen/X86/mingw-refptr.ll
+++ b/llvm/test/CodeGen/X86/mingw-refptr.ll
@@ -1,4 +1,5 @@
 ; RUN: llc < %s -mtriple=x86_64-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X64
+; RUN: llc < %s -mtriple=x86_64-pc-cygwin | FileCheck %s -check-prefix=CHECK-X64
 ; RUN: llc < %s -mtriple=i686-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X86
 ; RUN: llc < %s -mtriple=i686-w64-mingw32-none-elf | FileCheck %s -check-prefix=CHECK-X86-ELF
 
```

I tested that this is enough. Without the change in this patch, this added test fails (you can run `ninja llc && bin/llvm-lit -a path/to/llvm/test/CodeGen/X86/mingw-refptr.ll`), and with this change it succeeds.

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


More information about the llvm-commits mailing list