[llvm] SimplifyLibCalls: Use default globals address space when building new global strings. (PR #118729)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 05:48:28 PST 2024
================
@@ -0,0 +1,42 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; Test that the printf library call simplifier works correctly.
+;
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-G200"
+
+ at hello_world = addrspace(200) constant [13 x i8] c"hello world\0A\00"
+ at h = addrspace(200) constant [2 x i8] c"h\00"
+ at h2 = addrspace(200) constant [3 x i8] c"%%\00"
+ at percent = addrspace(200) constant [2 x i8] c"%\00"
+ at percent_c = addrspace(200) constant [3 x i8] c"%c\00"
+ at percent_d = addrspace(200) constant [3 x i8] c"%d\00"
+ at percent_f = addrspace(200) constant [3 x i8] c"%f\00"
+ at percent_s = addrspace(200) constant [4 x i8] c"%s\0A\00"
+ at empty = addrspace(200) constant [1 x i8] c"\00"
----------------
nikic wrote:
Remove the unused globals?
https://github.com/llvm/llvm-project/pull/118729
More information about the llvm-commits
mailing list