[llvm] [BOLT][AArch64] Fix ifuncs test header inclusion (PR #71741)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 15:06:16 PST 2023


https://github.com/rafaelauler created https://github.com/llvm/llvm-project/pull/71741

Summary: Do not include stdlib headers as these tests are built with -nostdlib. Tests outside of runtime folder also run cross-platforms, so an x86 machine wouldn't have access to the correct headers used in the aarch64 toolchain, even if it has an aarch64 compiler (clang itself).

>From 247831e9a49e640c8b87fc45ba5358a57baa9977 Mon Sep 17 00:00:00 2001
From: Rafael Auler <rafaelauler at fb.com>
Date: Wed, 8 Nov 2023 15:02:00 -0800
Subject: [PATCH] [BOLT][AArch64] Fix ifuncs test header inclusion

Summary: Do not include stdlib headers as these tests are built with
-nostdlib. Tests outside of runtime folder also run cross-platforms,
so an x86 machine wouldn't have access to the correct headers used in
the aarch64 toolchain, even if it has an aarch64 compiler (clang
itself).
---
 bolt/test/AArch64/ifunc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/bolt/test/AArch64/ifunc.c b/bolt/test/AArch64/ifunc.c
index dea2cf6bd543f0a..b9f014883230e5b 100644
--- a/bolt/test/AArch64/ifunc.c
+++ b/bolt/test/AArch64/ifunc.c
@@ -28,9 +28,6 @@
 // O0_CHECK: adr x{{[0-9]+}}, ifoo
 // O3_CHECK: b "{{resolver_foo|ifoo}}{{.*}}@PLT"
 
-#include <stdio.h>
-#include <string.h>
-
 static void foo() {}
 
 static void *resolver_foo(void) { return foo; }



More information about the llvm-commits mailing list