[llvm] r302513 - [X86] Clang option -fuse-init-array has no effect when generating for MCU target
Nikolai Bozhenov via llvm-commits
llvm-commits at lists.llvm.org
Tue May 9 03:14:04 PDT 2017
Author: n.bozhenov
Date: Tue May 9 05:14:03 2017
New Revision: 302513
URL: http://llvm.org/viewvc/llvm-project?rev=302513&view=rev
Log:
[X86] Clang option -fuse-init-array has no effect when generating for MCU target
Reviewers: Eugene.Zelenko, dschuff, craig.topper
Reviewed By: craig.topper
Subscribers: ahatanak, aaboud, DavidKreitzer, llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D32543
Patch by AndreiGrischenko <andrei.l.grischenko at intel.com>
Modified:
llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
llvm/trunk/test/CodeGen/X86/constructor.ll
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=302513&r1=302512&r2=302513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue May 9 05:14:03 2017
@@ -87,7 +87,7 @@ static std::unique_ptr<TargetLoweringObj
if (TT.isOSFreeBSD())
return llvm::make_unique<X86FreeBSDTargetObjectFile>();
- if (TT.isOSLinux() || TT.isOSNaCl())
+ if (TT.isOSLinux() || TT.isOSNaCl() || TT.isOSIAMCU())
return llvm::make_unique<X86LinuxNaClTargetObjectFile>();
if (TT.isOSFuchsia())
return llvm::make_unique<X86FuchsiaTargetObjectFile>();
Modified: llvm/trunk/test/CodeGen/X86/constructor.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/constructor.ll?rev=302513&r1=302512&r2=302513&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/constructor.ll (original)
+++ llvm/trunk/test/CodeGen/X86/constructor.ll Tue May 9 05:14:03 2017
@@ -3,6 +3,8 @@
; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=INIT-ARRAY %s
; RUN: llc -mtriple x86_64-unknown-freebsd < %s | FileCheck --check-prefix=INIT-ARRAY %s
; RUN: llc -mtriple x86_64-unknown-nacl < %s | FileCheck --check-prefix=NACL %s
+; RUN: llc -mtriple i586-intel-elfiamcu -use-ctors < %s | FileCheck %s --check-prefix=MCU-CTORS
+; RUN: llc -mtriple i586-intel-elfiamcu < %s | FileCheck %s --check-prefix=MCU-INIT-ARRAY
@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null}, { i32, void ()*, i8* } { i32 15, void ()* @g, i8* @v }]
@v = weak_odr global i8 0
@@ -37,3 +39,6 @@ entry:
; NACL-NEXT: .section .init_array,"aw", at init_array
; NACL-NEXT: .p2align 2
; NACL-NEXT: .long f
+
+; MCU-CTORS: .section .ctors,"aw", at progbits
+; MCU-INIT-ARRAY: .section .init_array,"aw", at init_array
More information about the llvm-commits
mailing list