[PATCH] D32543: [X86] Clang option -fuse-init-array has no effect when generating for MCU target

Nikolai Bozhenov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 03:27:26 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302513: [X86] Clang option -fuse-init-array has no effect when generating for MCU target (authored by n.bozhenov).

Changed prior to commit:
  https://reviews.llvm.org/D32543?vs=97866&id=98262#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32543

Files:
  llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
  llvm/trunk/test/CodeGen/X86/constructor.ll


Index: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
@@ -87,7 +87,7 @@
 
   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>();
Index: llvm/trunk/test/CodeGen/X86/constructor.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/constructor.ll
+++ llvm/trunk/test/CodeGen/X86/constructor.ll
@@ -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 @@
 ; 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32543.98262.patch
Type: text/x-patch
Size: 1707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170509/9646ddc9/attachment-0001.bin>


More information about the cfe-commits mailing list