[llvm] Print more descriptive error message when trying to link a global with appending linkage (PR #69613)

Gleb Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 09:18:46 PDT 2023


https://github.com/arrowd created https://github.com/llvm/llvm-project/pull/69613

This is a proper fix for https://github.com/llvm/llvm-project/issues/40308

>From 1e3bce38516997a7b55e0e27e0fb7d72c446f30e Mon Sep 17 00:00:00 2001
From: Gleb Popov <arrowd at freebsd.org>
Date: Thu, 19 Oct 2023 18:15:04 +0300
Subject: [PATCH] Print more descriptive error message when trying to link a
 global with appending linkage

---
 llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +-
 llvm/test/CodeGen/X86/AppendingLinkage.ll  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 072c55f79caa9dc..dab02272fadf9b9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2746,7 +2746,7 @@ bool AsmPrinter::emitSpecialLLVMGlobal(const GlobalVariable *GV) {
     return true;
   }
 
-  report_fatal_error("unknown special variable");
+  report_fatal_error("unknown special variable with appending linkage");
 }
 
 /// EmitLLVMUsedList - For targets that define a MAI::UsedDirective, mark each
diff --git a/llvm/test/CodeGen/X86/AppendingLinkage.ll b/llvm/test/CodeGen/X86/AppendingLinkage.ll
index 83bfbe85240afb1..ace5d192b7ea7ee 100644
--- a/llvm/test/CodeGen/X86/AppendingLinkage.ll
+++ b/llvm/test/CodeGen/X86/AppendingLinkage.ll
@@ -1,4 +1,4 @@
 ; RUN: not --crash llc < %s -mtriple=i686-- 2>&1 | FileCheck %s
 
-; CHECK: unknown special variable
+; CHECK: unknown special variable with appending linkage
 @foo = appending constant [1 x i32 ]zeroinitializer



More information about the llvm-commits mailing list