From ccffe38352fe4042c7fb3bb36ba1e6fea9df9e34 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Thu, 15 Dec 2016 16:56:16 +0000 Subject: [lanai] Simplify small section check in LowerGlobalAddress and treat ldata sections specially. Move the check for the code model into isGlobalInSmallSectionImpl and return false (not in small section) for variables placed in sections prefixed with .ldata (workaround for a tool limitation). llvm-svn: 289832 --- llvm/test/CodeGen/Lanai/codemodel.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/CodeGen/Lanai/codemodel.ll b/llvm/test/CodeGen/Lanai/codemodel.ll index e5ec7265924..6bc0dc4d398 100644 --- a/llvm/test/CodeGen/Lanai/codemodel.ll +++ b/llvm/test/CodeGen/Lanai/codemodel.ll @@ -28,3 +28,17 @@ entry: ret i32 %0 } +@y = local_unnamed_addr global i32* null, section ".ldata,block", align 8 + +define i32 @foo2() nounwind readonly { +entry: +; CHECK-SMALL-LABEL: foo2: +; CHECK-SMALL: mov hi(y), %r[[REGISTER:[0-9]+]] +; CHECK-SMALL: or %r[[REGISTER]], lo(y), %r[[REGISTER]] +; CHECK-LABEL: foo2: +; CHECK: mov hi(y), %r[[REGISTER:[0-9]+]] +; CHECK: or %r[[REGISTER]], lo(y), %r[[REGISTER]] + %0 = load i32*, i32** @y, align 8 + %1 = load i32, i32* %0, align 4 + ret i32 %1 +} -- cgit v1.2.3