Make the default triple optional by allowing an empty string

When building LLVM as a (potentially dynamic) library that can be linked against
by multiple compilers, the default triple is not really meaningful.
We allow to explicitely set it to an empty string when configuring LLVM.
In this case, said "target independent" tests in the test suite that are using
the default triple are disabled by matching the newly available feature
"default_triple".

Reviewers: probinson, echristo
Differential Revision: http://reviews.llvm.org/D12660

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini 2015-09-16 05:34:32 +00:00
parent ecd56aa518
commit 793a2b15e7
116 changed files with 57 additions and 25 deletions

View File

@ -420,8 +420,10 @@
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
/* Target triple LLVM will generate code for by default */
#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
/* Target triple LLVM will generate code for by default
* Doesn't use `cmakedefine` because it is allowed to be empty.
*/
#define LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
/* Installation directory for documentation */
#cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"

View File

@ -5,7 +5,7 @@
; Test to make sure that arguments are removed from the function if they are
; unnecessary. And clean up any types that frees up too.
; CHECK: target triple
; CHECK: ModuleID
; CHECK-NOT: struct.anon
%struct.anon = type { i32 }

View File

@ -1,3 +1,3 @@
if 'native' not in config.available_features:
if not config.target_triple:
config.unsupported = True

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
define void @iterative_hash_host_wide_int() {
%zero = alloca i32 ; <i32*> [#uses=2]

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
%struct..0anon = type { i32 }
%struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }

View File

@ -1,6 +1,7 @@
; RUN: llc < %s -march=ppc64
; RUN: llc < %s -march=ppc32
; RUN: llc < %s
; REQUIRES: default_triple
define void @bitap() {
entry:

View File

@ -1,6 +1,7 @@
; RUN: llc < %s -march=ppc64
; RUN: llc < %s -march=ppc32
; RUN: llc < %s
; REQUIRES: default_triple
@qsz.b = external global i1 ; <i1*> [#uses=1]

View File

@ -2,6 +2,7 @@
; RUN: llc < %s -march=ppc32 -mcpu=g3
; RUN: llc < %s -march=ppc32 -mcpu=g5
; PR1811
; REQUIRES: default_triple
define void @execute_shader(<4 x float>* %OUT, <4 x float>* %IN, <4 x float>*
%CONST) {

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
; This used to cause a crash. A standard load is converted to a pre-increment
; load. Later the pre-increment load is combined with a subsequent SRL to

View File

@ -1,5 +1,6 @@
; RUN: llc < %s
; PR933
; REQUIRES: default_triple
define fastcc i1 @test() {
ret i1 true

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
define <2 x i64> @_mm_insert_epi16(<2 x i64> %a, i32 %b, i32 %imm) nounwind readnone {
entry:

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
define <2 x i64> @_mm_movpi64_pi64(<1 x i64> %a, <1 x i64> %b) nounwind readnone {
entry:

View File

@ -1,4 +1,6 @@
; RUN: llc -O1 < %s
; REQUIRES: default_triple
; ModuleID = 'pr6157.bc'
; formerly crashed in SelectionDAGBuilder

View File

@ -1,4 +1,5 @@
; RUN: llc -O0 -relocation-model pic < %s -o /dev/null
; REQUIRES: default_triple
; PR7545
@.str = private constant [4 x i8] c"one\00", align 1 ; <[4 x i8]*> [#uses=1]
@.str1 = private constant [4 x i8] c"two\00", align 1 ; <[5 x i8]*> [#uses=1]

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
declare i8* @llvm_gc_allocate(i32)

View File

@ -1,4 +1,5 @@
; RUN: llc < %s -O0
; REQUIRES: default_triple
define i32 @main() {
entry:

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
%Env = type i8*

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
; Examples that exhibits a bug in DAGCombine. The case is triggered by the
; following program. The bug is DAGCombine assumes that the bit convert

View File

@ -1,4 +1,5 @@
; RUN: llc < %s
; REQUIRES: default_triple
; Legalization test that requires scalarizing a vector.

View File

@ -0,0 +1,3 @@
if not config.target_triple:
config.unsupported = True

View File

@ -1,3 +0,0 @@
if 'native' not in config.available_features:
config.unsupported = True

View File

@ -4,7 +4,7 @@
; RUN: llc -O3 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox
; RUN: llc -misched-postra -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-MORE
; REQUIRES: asserts, native
; REQUIRES: asserts, default_triple
; This test verifies that we don't run Machine Function optimizations
; on optnone functions.

View File

@ -1,5 +1,4 @@
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; REQUIRE: native
; Check for the presence of attribute optnone in the disassembly.

View File

@ -15,6 +15,8 @@
; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.macho.o %T/bcsection.macho.bco
; RUN: llvm-nm %T/bcsection.macho.o | FileCheck %s
; REQUIRES: default_triple
; CHECK: main
define i32 @main() {
ret i32 0

View File

@ -1,4 +1,5 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -o %t2 %t1
; REQUIRES: default_triple
module asm ".align 4"

Some files were not shown because too many files have changed in this diff Show More