Index: llvm/include/llvm/ADT/Triple.h =================================================================== --- llvm/include/llvm/ADT/Triple.h +++ llvm/include/llvm/ADT/Triple.h @@ -771,6 +771,11 @@ return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment(); } + /// Tests whether the target uses -data-sections as default. + bool hasDefaultDataSections() const { + return isOSBinFormatXCOFF() || isWasm(); + } + /// @} /// @name Mutators /// @{ Index: llvm/include/llvm/Target/TargetMachine.h =================================================================== --- llvm/include/llvm/Target/TargetMachine.h +++ llvm/include/llvm/Target/TargetMachine.h @@ -250,9 +250,12 @@ } /// Return true if data objects should be emitted into their own section, - /// corresponds to -fdata-sections. + /// corresponds to -fdata-sections. If -fdata-sections is not explicitly + /// specified, use target triple to decide the default. bool getDataSections() const { - return Options.DataSections; + if (Options.HasExplicitDataSections) + return Options.DataSections; + return getTargetTriple().hasDefaultDataSections(); } /// Return true if functions should be emitted into their own section, Index: llvm/include/llvm/Target/TargetOptions.h =================================================================== --- llvm/include/llvm/Target/TargetOptions.h +++ llvm/include/llvm/Target/TargetOptions.h @@ -123,9 +123,10 @@ EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false), DisableIntegratedAS(false), RelaxELFRelocations(false), FunctionSections(false), DataSections(false), - UniqueSectionNames(true), UniqueBasicBlockSectionNames(false), - TrapUnreachable(false), NoTrapAfterNoreturn(false), TLSSize(0), - EmulatedTLS(false), ExplicitEmulatedTLS(false), EnableIPRA(false), + HasExplicitDataSections(false), UniqueSectionNames(true), + UniqueBasicBlockSectionNames(false), TrapUnreachable(false), + NoTrapAfterNoreturn(false), TLSSize(0), EmulatedTLS(false), + ExplicitEmulatedTLS(false), EnableIPRA(false), EmitStackSizeSection(false), EnableMachineOutliner(false), EnableMachineFunctionSplitter(false), SupportsDefaultOutlining(false), EmitAddrsig(false), EmitCallSiteInfo(false), @@ -230,6 +231,9 @@ /// Emit data into separate sections. unsigned DataSections : 1; + /// Whether -data-sections or -data-sections=false is set. + unsigned HasExplicitDataSections : 1; + unsigned UniqueSectionNames : 1; /// Use unique names for basic block sections. Index: llvm/lib/CodeGen/CommandFlags.cpp =================================================================== --- llvm/lib/CodeGen/CommandFlags.cpp +++ llvm/lib/CodeGen/CommandFlags.cpp @@ -478,6 +478,7 @@ Options.UseInitArray = !getUseCtors(); Options.RelaxELFRelocations = getRelaxELFRelocations(); Options.DataSections = getDataSections(); + Options.HasExplicitDataSections = getExplicitDataSections().hasValue(); Options.FunctionSections = getFunctionSections(); Options.BBSections = getBBSectionsMode(Options); Options.UniqueSectionNames = getUniqueSectionNames(); Index: llvm/test/CodeGen/PowerPC/aix-alias.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-alias.ll +++ llvm/test/CodeGen/PowerPC/aix-alias.ll @@ -2,10 +2,10 @@ ; is implemnted. ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | \ +; RUN: -mattr=-altivec -data-sections=false < %s | \ ; RUN: FileCheck --check-prefix=ASM %s ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | \ +; RUN: -mattr=-altivec -data-sections=false < %s | \ ; RUN: FileCheck --check-prefix=ASM %s @var = global i32 42 Index: llvm/test/CodeGen/PowerPC/aix-bytestring.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-bytestring.ll +++ llvm/test/CodeGen/PowerPC/aix-bytestring.ll @@ -1,5 +1,5 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s -; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | FileCheck %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | FileCheck %s @str = constant [256 x i8] c"\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7F\80\81\82\83\84\85\86\87\88\89\8A\8B\8C\8D\8E\8F\90\91\92\93\94\95\96\97\98\99\9A\9B\9C\9D\9E\9F\A0\A1\A2\A3\A4\A5\A6\A7\A8\A9\AA\AB\AC\AD\AE\AF\B0\B1\B2\B3\B4\B5\B6\B7\B8\B9\BA\BB\BC\BD\BE\BF\C0\C1\C2\C3\C4\C5\C6\C7\C8\C9\CA\CB\CC\CD\CE\CF\D0\D1\D2\D3\D4\D5\D6\D7\D8\D9\DA\DB\DC\DD\DE\DF\E0\E1\E2\E3\E4\E5\E6\E7\E8\E9\EA\EB\EC\ED\EE\EF\F0\F1\F2\F3\F4\F5\F6\F7\F8\F9\FA\FB\FC\FD\FE\FF\00", align 1 Index: llvm/test/CodeGen/PowerPC/aix-extern-weak.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-extern-weak.ll +++ llvm/test/CodeGen/PowerPC/aix-extern-weak.ll @@ -1,15 +1,16 @@ ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT32 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT64 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s ; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | FileCheck --check-prefix=XCOFF64 %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o 2>&1 < %s | \ +; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. Index: llvm/test/CodeGen/PowerPC/aix-extern.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-extern.ll +++ llvm/test/CodeGen/PowerPC/aix-extern.ll @@ -1,15 +1,15 @@ ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT32 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT64 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s ; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | FileCheck --check-prefix=XCOFF64 %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o 2>&1 < %s | FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. @bar_p = global i32 (...)* @bar_ref, align 4 Index: llvm/test/CodeGen/PowerPC/aix-readonly-with-relocation.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-readonly-with-relocation.ll +++ llvm/test/CodeGen/PowerPC/aix-readonly-with-relocation.ll @@ -1,5 +1,7 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff --relocation-model=pic < %s | FileCheck %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff --relocation-model=pic < %s | FileCheck --check-prefix=CHECK64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff \ +; RUN: --relocation-model=pic -data-sections=false < %s | FileCheck %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: --relocation-model=pic -data-sections=false < %s | FileCheck --check-prefix=CHECK64 %s @a = common global i32 0 @b = constant i32* @a Index: llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll +++ llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll @@ -1,5 +1,7 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefix=CHECK64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff \ +; RUN: -data-sections=false < %s | FileCheck %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -data-sections=false < %s | FileCheck --check-prefix=CHECK64 %s @foo_ptr = global void (...)* @foo declare void @foo(...) Index: llvm/test/CodeGen/PowerPC/aix-return55.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-return55.ll +++ llvm/test/CodeGen/PowerPC/aix-return55.ll @@ -1,5 +1,5 @@ -; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s -; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs -filetype=obj -o %t.o < %s +; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs -data-sections=false < %s | FileCheck %s +; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s ; RUN: llvm-readobj -sections %t.o | FileCheck --check-prefix=CHECKSECT %s Index: llvm/test/CodeGen/PowerPC/aix-weak.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-weak.ll +++ llvm/test/CodeGen/PowerPC/aix-weak.ll @@ -1,15 +1,16 @@ ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT32 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | FileCheck --check-prefixes=COMMON,BIT64 %s +; RUN: -mattr=-altivec -data-sections=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s ; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | FileCheck --check-prefix=XCOFF64 %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o 2>&1 < %s | \ +; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. @foo_weak_p = global void (...)* bitcast (void ()* @foo_ref_weak to void (...)*), align 4 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll @@ -6,6 +6,15 @@ ; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefix=CHECKOBJ %s ; RUN: llvm-readobj -syms %t.o | FileCheck --check-prefix=CHECKSYM %s +;; Test to see if the default is correct for -data-sections on AIX. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK32 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefix=CHECKOBJ %s +; RUN: llvm-readobj -syms %t.o | FileCheck --check-prefix=CHECKSYM %s + @ivar = local_unnamed_addr global i32 35, align 4 @const_ivar = constant i32 35, align 4 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll @@ -1,15 +1,15 @@ ; This file tests the codegen of initialized and common variables in AIX ; assembly and XCOFF object files. -; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK32 %s -; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK64 %s +; RUN: llc -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | FileCheck --check-prefixes=CHECK,CHECK32 %s +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | FileCheck --check-prefixes=CHECK,CHECK64 %s -; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llc -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --section-headers --file-header %t.o | \ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ +; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj < %s 2>&1 | \ ; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. Index: llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll @@ -1,11 +1,14 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,ASM32 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,ASM64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,ASM32 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,ASM64 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj -r --expand-relocs -t %t.o | FileCheck --check-prefixes=RELOC,SYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s +; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -data-sections=false -filetype=obj < %s 2>&1 | \ +; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. @common = common global i32 0, align 4 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll @@ -1,8 +1,10 @@ ; This file tests the codegen of mergeable const in AIX assembly. ; This file also tests mergeable const in XCOFF object file generation. -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK32 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK64 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK32 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s ; RUN: llvm-readobj -syms %t.o | FileCheck --check-prefix=CHECKSYM %s Index: llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll @@ -4,11 +4,11 @@ ; tests for XCOFF object files. ; RUN: llc -verify-machineinstrs -mcpu=pwr4 \ -; RUN: -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s +; RUN: -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | FileCheck %s ; RUN: llc -verify-machineinstrs -mcpu=pwr4 \ -; RUN: -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s +; RUN: -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | FileCheck %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s @magic16 = private unnamed_addr constant [4 x i16] [i16 264, i16 272, i16 213, i16 0], align 2 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll @@ -1,4 +1,4 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --section-headers --file-header %t.o | \ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck --check-prefix=RELOC %s @@ -6,7 +6,7 @@ ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s ; RUN: llvm-objdump -r %t.o | FileCheck --check-prefix=DIS_REL %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -mattr=-altivec -filetype=obj < %s 2>&1 | \ +; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -mattr=-altivec -data-sections=false -filetype=obj < %s 2>&1 | \ ; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. Index: llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll @@ -1,13 +1,15 @@ -; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK32 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefixes=CHECK,CHECK64 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK32 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \ +; RUN: FileCheck --check-prefixes=CHECK,CHECK64 %s -; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --section-headers --file-header %t.o | \ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ +; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj < %s 2>&1 | \ ; RUN: FileCheck --check-prefix=XCOFF64 %s ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. Index: llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll @@ -4,11 +4,11 @@ ;; tests for 64-bit mode are omitted. ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec < %s | \ +; RUN: -mattr=-altivec -data-sections=false < %s | \ ; RUN: FileCheck --check-prefix=ASM %s ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -D -r --symbol-description %t.o | \ ; RUN: FileCheck --check-prefix=OBJ %s Index: llvm/test/CodeGen/PowerPC/aix-xcoff-used.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-used.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-used.ll @@ -1,10 +1,10 @@ ;; This test verifies llc on AIX would not crash when llvm.used and ;; llvm.compiler.used is presented in the IR. -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | \ +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \ ; RUN: FileCheck %s -; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | \ +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \ ; RUN: FileCheck %s @keep_this = internal global i32 2, align 4 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll @@ -1,6 +1,6 @@ -; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec < %s | \ +; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec -data-sections=false < %s | \ ; RUN: FileCheck %s -; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec < %s |\ +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec -data-sections=false < %s |\ ; RUN: FileCheck %s @b = global i32 0, align 4