From: Asiri Rathnayake Date: Wed, 4 Jan 2017 14:43:51 +0000 (+0000) Subject: Fix x86 gold tests on non-x86 targets. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f56a7f910e5888dd24a0dd463f1835848a474256;p=llvm Fix x86 gold tests on non-x86 targets. These tests are missing a target triple and the -m elf_x86_64 gold option, which makes them fail on non-x86 targets. Differential revision: https://reviews.llvm.org/D28285 Reviewers: tejohnson git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290965 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/gold/X86/Inputs/thinlto.ll b/test/tools/gold/X86/Inputs/thinlto.ll index b81de922b4d..31c72ec4653 100644 --- a/test/tools/gold/X86/Inputs/thinlto.ll +++ b/test/tools/gold/X86/Inputs/thinlto.ll @@ -1,4 +1,5 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" define void @g() { entry: diff --git a/test/tools/gold/X86/Inputs/thinlto_archive1.ll b/test/tools/gold/X86/Inputs/thinlto_archive1.ll index b81de922b4d..31c72ec4653 100644 --- a/test/tools/gold/X86/Inputs/thinlto_archive1.ll +++ b/test/tools/gold/X86/Inputs/thinlto_archive1.ll @@ -1,4 +1,5 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" define void @g() { entry: diff --git a/test/tools/gold/X86/Inputs/thinlto_archive2.ll b/test/tools/gold/X86/Inputs/thinlto_archive2.ll index c2bda1712a4..2136ec3471d 100644 --- a/test/tools/gold/X86/Inputs/thinlto_archive2.ll +++ b/test/tools/gold/X86/Inputs/thinlto_archive2.ll @@ -1,4 +1,5 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" define void @h() { entry: diff --git a/test/tools/gold/X86/comdat.ll b/test/tools/gold/X86/comdat.ll index 8ed520c17c0..7cb1855df2d 100644 --- a/test/tools/gold/X86/comdat.ll +++ b/test/tools/gold/X86/comdat.ll @@ -1,11 +1,13 @@ ; RUN: llvm-as %s -o %t1.o ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o ; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t1.o %t2.o \ +; RUN: -m elf_x86_64 \ ; RUN: -plugin-opt=save-temps ; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt ; RUN: llvm-readobj -t %t3.o | FileCheck --check-prefix=OBJ %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" $c1 = comdat any diff --git a/test/tools/gold/X86/opt-level.ll b/test/tools/gold/X86/opt-level.ll index d072866f7db..a48c551a9ae 100644 --- a/test/tools/gold/X86/opt-level.ll +++ b/test/tools/gold/X86/opt-level.ll @@ -1,11 +1,14 @@ ; RUN: llvm-as -o %t.bc %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -m elf_x86_64 \ ; RUN: -plugin-opt=O0 -r -o %t.o %t.bc ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -m elf_x86_64 \ ; RUN: -plugin-opt=O1 -r -o %t.o %t.bc ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -m elf_x86_64 \ ; RUN: -plugin-opt=O2 -r -o %t.o %t.bc ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s @@ -14,6 +17,7 @@ ; CHECK-O2-NOT: define internal void @foo( target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" define internal void @foo() { ret void diff --git a/test/tools/gold/X86/pr25907.ll b/test/tools/gold/X86/pr25907.ll index f33f2f24245..bfdf4fc9049 100644 --- a/test/tools/gold/X86/pr25907.ll +++ b/test/tools/gold/X86/pr25907.ll @@ -1,10 +1,12 @@ ; RUN: llvm-as %s -o %t.o ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: -shared %t.o -o %t2 ; RUN: llvm-nm %t2 | FileCheck %s ; CHECK: T main target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" @main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 16 diff --git a/test/tools/gold/X86/stats.ll b/test/tools/gold/X86/stats.ll index d278610789f..15aa080d6fc 100644 --- a/test/tools/gold/X86/stats.ll +++ b/test/tools/gold/X86/stats.ll @@ -2,6 +2,7 @@ ; RUN: llvm-as %s -o %t.o ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -shared \ +; RUN: -m elf_x86_64 \ ; RUN: -plugin-opt=-stats %t.o -o %t2 2>&1 | FileCheck %s ; CHECK: Statistics Collected diff --git a/test/tools/gold/X86/strip_names.ll b/test/tools/gold/X86/strip_names.ll index bb974c8aebe..dd4a94f83d6 100644 --- a/test/tools/gold/X86/strip_names.ll +++ b/test/tools/gold/X86/strip_names.ll @@ -1,11 +1,13 @@ ; RUN: llvm-as %s -o %t.o ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=save-temps \ ; RUN: -shared %t.o -o %t2.o ; RUN: llvm-dis %t2.o.0.2.internalize.bc -o - | FileCheck %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=emit-llvm \ ; RUN: -shared %t.o -o %t2.o ; RUN: llvm-dis %t2.o -o - | FileCheck ---check-prefix=NONAME %s @@ -25,6 +27,7 @@ ; NONAME: ret i32 %3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" @GlobalValueName = global i32 0 diff --git a/test/tools/gold/X86/thinlto.ll b/test/tools/gold/X86/thinlto.ll index 9ce070a6b5e..aee7268dfb9 100644 --- a/test/tools/gold/X86/thinlto.ll +++ b/test/tools/gold/X86/thinlto.ll @@ -3,11 +3,13 @@ ; RUN: llvm-as %s -o %t.o ; RUN: llvm-as %p/Inputs/thinlto.ll -o %t2.o ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=thinlto-index-only \ ; RUN: -shared %t.o %t2.o -o %t3 ; RUN: not test -e %t3 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=thinlto \ ; RUN: -shared %t.o %t2.o -o %t4 ; RUN: llvm-nm %t4 | FileCheck %s --check-prefix=NM @@ -18,6 +20,7 @@ ; Ensure gold generates an index and not a binary if requested. ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=thinlto-index-only \ ; RUN: -shared %t.o %t2.o -o %t3 @@ -28,6 +31,7 @@ ; Ensure gold generates an index as well as a binary with save-temps in ThinLTO mode. ; First force single-threaded mode ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=save-temps \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=jobs=1 \ @@ -37,6 +41,7 @@ ; Check with --no-map-whole-files ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=save-temps \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=jobs=1 \ @@ -47,6 +52,7 @@ ; Next force multi-threaded mode ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=save-temps \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=jobs=2 \ @@ -56,6 +62,7 @@ ; Test --plugin-opt=obj-path to ensure unique object files generated. ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -m elf_x86_64 \ ; RUN: --plugin-opt=thinlto \ ; RUN: --plugin-opt=jobs=2 \ ; RUN: --plugin-opt=obj-path=%t5.o \ @@ -116,6 +123,7 @@ ; COMBINED-NEXT: