From 563fca450926fce61d90ea7f8033735a2ccdf8c4 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 17 May 2014 04:28:08 +0000 Subject: [PATCH] ARM: use the proper target object format for WoA WoA uses COFF, not ELF. ARMISelLowering::createTLOF would previously return ELF for any non-MachO platform. This was a missed site when the original change for target format support for Windows on ARM was done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209057 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMISelLowering.cpp | 3 ++- test/CodeGen/ARM/Windows/read-only-data.ll | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/CodeGen/ARM/Windows/read-only-data.ll diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index c2d9b7a1248..d0d1018f34e 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -158,7 +158,8 @@ void ARMTargetLowering::addQRTypeForNEON(MVT VT) { static TargetLoweringObjectFile *createTLOF(TargetMachine &TM) { if (TM.getSubtarget().isTargetMachO()) return new TargetLoweringObjectFileMachO(); - + if (TM.getSubtarget().isTargetWindows()) + return new TargetLoweringObjectFileCOFF(); return new ARMElfTargetObjectFile(); } diff --git a/test/CodeGen/ARM/Windows/read-only-data.ll b/test/CodeGen/ARM/Windows/read-only-data.ll new file mode 100644 index 00000000000..965018df8fd --- /dev/null +++ b/test/CodeGen/ARM/Windows/read-only-data.ll @@ -0,0 +1,15 @@ +; RUN: llc -mtriple thumbv7-windows -filetype asm -o - %s | FileCheck %s + +@.str = private unnamed_addr constant [7 x i8] c"string\00", align 1 + +declare arm_aapcs_vfpcc void @callee(i8*) + +define arm_aapcs_vfpcc void @function() { +entry: + call arm_aapcs_vfpcc void @callee(i8* getelementptr inbounds ([7 x i8]* @.str, i32 0, i32 0)) + ret void +} + +; CHECK: .section ".rdata","rd" +; CHECK-NOT: .section ".rodata.str1.1" + -- 2.34.1