[clang] Symbol names on arm64 can have an extra char on front of name (PR #194937)
Sean Perry via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 07:33:39 PDT 2026
https://github.com/perry-ca updated https://github.com/llvm/llvm-project/pull/194937
>From 212d6776c3cc01c6511957bb3e39580efa4d717f Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Wed, 29 Apr 2026 12:04:40 -0400
Subject: [PATCH 1/2] Symbol names on arm64 have an extra char on front of name
---
clang/test/CodeGen/2008-07-31-asm-labels.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/clang/test/CodeGen/2008-07-31-asm-labels.c b/clang/test/CodeGen/2008-07-31-asm-labels.c
index 84c7f447fc599..a7f2f84119254 100644
--- a/clang/test/CodeGen/2008-07-31-asm-labels.c
+++ b/clang/test/CodeGen/2008-07-31-asm-labels.c
@@ -1,11 +1,11 @@
// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: not grep "@pipe()" %t
-// RUN: grep '@_thisIsNotAPipe' %t | count 3
+// RUN: not grep "@.*pipe()" %t
+// RUN: grep '@.*_thisIsNotAPipe' %t | count 3
// RUN: not grep '@g0' %t
-// RUN: grep '@_renamed' %t | count 2
+// RUN: grep '@.*_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
-// RUN: not grep "@pipe()" %t
-// RUN: grep '@_thisIsNotAPipe' %t | count 3
+// RUN: not grep "@.*pipe()" %t
+// RUN: grep '@.*_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
void pipe() asm("_thisIsNotAPipe");
>From 3fb832c7bb6cf6b8b37fac30e01608589ece04ef Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Fri, 1 May 2026 10:32:31 -0400
Subject: [PATCH 2/2] Rewrite using FileCheck
---
clang/test/CodeGen/2008-07-31-asm-labels.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/clang/test/CodeGen/2008-07-31-asm-labels.c b/clang/test/CodeGen/2008-07-31-asm-labels.c
index a7f2f84119254..b3076dab9cb9f 100644
--- a/clang/test/CodeGen/2008-07-31-asm-labels.c
+++ b/clang/test/CodeGen/2008-07-31-asm-labels.c
@@ -1,26 +1,25 @@
-// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: not grep "@.*pipe()" %t
-// RUN: grep '@.*_thisIsNotAPipe' %t | count 3
-// RUN: not grep '@g0' %t
-// RUN: grep '@.*_renamed' %t | count 2
-// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
-// RUN: not grep "@.*pipe()" %t
-// RUN: grep '@.*_thisIsNotAPipe' %t | count 3
+// RUN: %clang_cc1 -emit-llvm -o - %s |FileCheck %s -check-prefixes CHECK,CHECKREF
+// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o - %s |FileCheck %s -check-prefixes CHECK,CHECKDEF
// <rdr://6116729>
+//CHECK: _renamed{{.*}} = external global
void pipe() asm("_thisIsNotAPipe");
void f0(void) {
pipe();
+//CHECK: call {{.*}}_thisIsNotAPipe
}
void pipe(int);
+//CHECKREF: declare {{.*}}_thisIsNotAPipe
void f1(void) {
pipe(1);
+//CHECK: call {{.*}}_thisIsNotAPipe
}
#ifdef USE_DEF
+//CHECKDEF: define {{.*}}_thisIsNotAPipe
void pipe(int arg) {
int x = 10;
}
@@ -30,4 +29,5 @@ void pipe(int arg) {
extern int g0 asm("_renamed");
int f2(void) {
return g0;
+//CHECK: load {{.*}}_renamed
}
More information about the cfe-commits
mailing list