OSDN Git Service

Make the default triple optional by allowing an empty string
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 16 Sep 2015 05:34:32 +0000 (05:34 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 16 Sep 2015 05:34:32 +0000 (05:34 +0000)
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

116 files changed:
include/llvm/Config/config.h.cmake
test/BugPoint/remove_arguments_test.ll
test/CodeGen/Generic/lit.local.cfg
test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll
test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll
test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll
test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll
test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll
test/CodeGen/PowerPC/load-shift-combine.ll
test/CodeGen/X86/2006-10-02-BoolRetCrash.ll
test/CodeGen/X86/2009-06-05-VariableIndexInsert.ll
test/CodeGen/X86/2009-06-06-ConcatVectors.ll
test/CodeGen/X86/2010-02-01-DbgValueCrash.ll
test/CodeGen/X86/2010-07-06-DbgCrash.ll
test/CodeGen/X86/GC/alloc_loop.ll
test/CodeGen/X86/GC/cg-O0.ll
test/CodeGen/X86/GC/lower_gcroot.ll
test/CodeGen/X86/extractelement-shuffle.ll
test/CodeGen/X86/vshift_scalar.ll
test/DebugInfo/Generic/2009-10-16-Phi.ll [moved from test/DebugInfo/2009-10-16-Phi.ll with 100% similarity]
test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll [moved from test/DebugInfo/2009-11-03-InsertExtractValue.ll with 100% similarity]
test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll [moved from test/DebugInfo/2009-11-05-DeadGlobalVariable.ll with 100% similarity]
test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll [moved from test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll with 100% similarity]
test/DebugInfo/Generic/2009-11-10-CurrentFn.ll [moved from test/DebugInfo/2009-11-10-CurrentFn.ll with 100% similarity]
test/DebugInfo/Generic/2010-01-05-DbgScope.ll [moved from test/DebugInfo/2010-01-05-DbgScope.ll with 100% similarity]
test/DebugInfo/Generic/2010-03-12-llc-crash.ll [moved from test/DebugInfo/2010-03-12-llc-crash.ll with 100% similarity]
test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll [moved from test/DebugInfo/2010-03-19-DbgDeclare.ll with 100% similarity]
test/DebugInfo/Generic/2010-03-24-MemberFn.ll [moved from test/DebugInfo/2010-03-24-MemberFn.ll with 100% similarity]
test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll [moved from test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll with 100% similarity]
test/DebugInfo/Generic/2010-04-19-FramePtr.ll [moved from test/DebugInfo/2010-04-19-FramePtr.ll with 100% similarity]
test/DebugInfo/Generic/2010-05-03-DisableFramePtr.ll [moved from test/DebugInfo/2010-05-03-DisableFramePtr.ll with 100% similarity]
test/DebugInfo/Generic/2010-05-03-OriginDIE.ll [moved from test/DebugInfo/2010-05-03-OriginDIE.ll with 100% similarity]
test/DebugInfo/Generic/2010-05-10-MultipleCU.ll [moved from test/DebugInfo/2010-05-10-MultipleCU.ll with 100% similarity]
test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll [moved from test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll with 100% similarity]
test/DebugInfo/Generic/2010-07-19-Crash.ll [moved from test/DebugInfo/2010-07-19-Crash.ll with 100% similarity]
test/DebugInfo/Generic/2010-10-01-crash.ll [moved from test/DebugInfo/2010-10-01-crash.ll with 100% similarity]
test/DebugInfo/Generic/PR20038.ll [moved from test/DebugInfo/PR20038.ll with 100% similarity]
test/DebugInfo/Generic/accel-table-hash-collisions.ll [moved from test/DebugInfo/accel-table-hash-collisions.ll with 100% similarity]
test/DebugInfo/Generic/array.ll [moved from test/DebugInfo/array.ll with 100% similarity]
test/DebugInfo/Generic/block-asan.ll [moved from test/DebugInfo/block-asan.ll with 100% similarity]
test/DebugInfo/Generic/bug_null_debuginfo.ll [moved from test/DebugInfo/bug_null_debuginfo.ll with 100% similarity]
test/DebugInfo/Generic/constant-pointers.ll [moved from test/DebugInfo/constant-pointers.ll with 100% similarity]
test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll [moved from test/DebugInfo/constant-sdnodes-have-dbg-location.ll with 100% similarity]
test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll [moved from test/DebugInfo/constantfp-sdnodes-have-dbg-location.ll with 100% similarity]
test/DebugInfo/Generic/cross-cu-inlining.ll [moved from test/DebugInfo/cross-cu-inlining.ll with 100% similarity]
test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll [moved from test/DebugInfo/cross-cu-linkonce-distinct.ll with 100% similarity]
test/DebugInfo/Generic/cross-cu-linkonce.ll [moved from test/DebugInfo/cross-cu-linkonce.ll with 100% similarity]
test/DebugInfo/Generic/cu-range-hole.ll [moved from test/DebugInfo/cu-range-hole.ll with 100% similarity]
test/DebugInfo/Generic/cu-ranges.ll [moved from test/DebugInfo/cu-ranges.ll with 100% similarity]
test/DebugInfo/Generic/dbg-at-specficiation.ll [moved from test/DebugInfo/X86/dbg-at-specficiation.ll with 100% similarity]
test/DebugInfo/Generic/dead-argument-order.ll [moved from test/DebugInfo/dead-argument-order.ll with 100% similarity]
test/DebugInfo/Generic/debug-info-always-inline.ll [moved from test/DebugInfo/debug-info-always-inline.ll with 100% similarity]
test/DebugInfo/Generic/debug-info-qualifiers.ll [moved from test/DebugInfo/debug-info-qualifiers.ll with 100% similarity]
test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll [moved from test/DebugInfo/debuginfofinder-forward-declaration.ll with 100% similarity]
test/DebugInfo/Generic/debuginfofinder-multiple-cu.ll [moved from test/DebugInfo/debuginfofinder-multiple-cu.ll with 100% similarity]
test/DebugInfo/Generic/dwarf-public-names.ll [moved from test/DebugInfo/dwarf-public-names.ll with 100% similarity]
test/DebugInfo/Generic/empty.ll [moved from test/DebugInfo/empty.ll with 100% similarity]
test/DebugInfo/Generic/enum-types.ll [moved from test/DebugInfo/enum-types.ll with 100% similarity]
test/DebugInfo/Generic/enum.ll [moved from test/DebugInfo/enum.ll with 100% similarity]
test/DebugInfo/Generic/global.ll [moved from test/DebugInfo/global.ll with 100% similarity]
test/DebugInfo/Generic/gmlt.test [moved from test/DebugInfo/gmlt.test with 100% similarity]
test/DebugInfo/Generic/gvn.ll [moved from test/DebugInfo/gvn.ll with 100% similarity]
test/DebugInfo/Generic/incorrect-variable-debugloc.ll [moved from test/DebugInfo/incorrect-variable-debugloc.ll with 100% similarity]
test/DebugInfo/Generic/incorrect-variable-debugloc1.ll [moved from test/DebugInfo/incorrect-variable-debugloc1.ll with 100% similarity]
test/DebugInfo/Generic/inheritance.ll [moved from test/DebugInfo/inheritance.ll with 100% similarity]
test/DebugInfo/Generic/inline-debug-info-multiret.ll [moved from test/DebugInfo/inline-debug-info-multiret.ll with 100% similarity]
test/DebugInfo/Generic/inline-debug-info.ll [moved from test/DebugInfo/inline-debug-info.ll with 100% similarity]
test/DebugInfo/Generic/inline-no-debug-info.ll [moved from test/DebugInfo/inline-no-debug-info.ll with 100% similarity]
test/DebugInfo/Generic/inline-scopes.ll [moved from test/DebugInfo/inline-scopes.ll with 100% similarity]
test/DebugInfo/Generic/inlined-arguments.ll [moved from test/DebugInfo/inlined-arguments.ll with 100% similarity]
test/DebugInfo/Generic/inlined-vars.ll [moved from test/DebugInfo/inlined-vars.ll with 100% similarity]
test/DebugInfo/Generic/lit.local.cfg [new file with mode: 0644]
test/DebugInfo/Generic/location-verifier.ll [moved from test/DebugInfo/location-verifier.ll with 100% similarity]
test/DebugInfo/Generic/lto-comp-dir.ll [moved from test/DebugInfo/lto-comp-dir.ll with 100% similarity]
test/DebugInfo/Generic/member-order.ll [moved from test/DebugInfo/member-order.ll with 100% similarity]
test/DebugInfo/Generic/member-pointers.ll [moved from test/DebugInfo/member-pointers.ll with 100% similarity]
test/DebugInfo/Generic/missing-abstract-variable.ll [moved from test/DebugInfo/missing-abstract-variable.ll with 100% similarity]
test/DebugInfo/Generic/multiline.ll [moved from test/DebugInfo/multiline.ll with 100% similarity]
test/DebugInfo/Generic/namespace.ll [moved from test/DebugInfo/namespace.ll with 100% similarity]
test/DebugInfo/Generic/namespace_function_definition.ll [moved from test/DebugInfo/namespace_function_definition.ll with 100% similarity]
test/DebugInfo/Generic/namespace_inline_function_definition.ll [moved from test/DebugInfo/namespace_inline_function_definition.ll with 100% similarity]
test/DebugInfo/Generic/nodebug.ll [moved from test/DebugInfo/nodebug.ll with 100% similarity]
test/DebugInfo/Generic/piece-verifier.ll [moved from test/DebugInfo/piece-verifier.ll with 100% similarity]
test/DebugInfo/Generic/recursive_inlining.ll [moved from test/DebugInfo/X86/recursive_inlining.ll with 100% similarity]
test/DebugInfo/Generic/restrict.ll [moved from test/DebugInfo/restrict.ll with 100% similarity]
test/DebugInfo/Generic/skeletoncu.ll [moved from test/DebugInfo/skeletoncu.ll with 100% similarity]
test/DebugInfo/Generic/sugared-constants.ll [moved from test/DebugInfo/sugared-constants.ll with 100% similarity]
test/DebugInfo/Generic/template-recursive-void.ll [moved from test/DebugInfo/template-recursive-void.ll with 100% similarity]
test/DebugInfo/Generic/tu-composite.ll [moved from test/DebugInfo/tu-composite.ll with 100% similarity]
test/DebugInfo/Generic/tu-member-pointer.ll [moved from test/DebugInfo/tu-member-pointer.ll with 100% similarity]
test/DebugInfo/Generic/two-cus-from-same-file.ll [moved from test/DebugInfo/two-cus-from-same-file.ll with 100% similarity]
test/DebugInfo/Generic/typedef.ll [moved from test/DebugInfo/typedef.ll with 100% similarity]
test/DebugInfo/Generic/unconditional-branch.ll [moved from test/DebugInfo/unconditional-branch.ll with 100% similarity]
test/DebugInfo/Generic/varargs.ll [moved from test/DebugInfo/varargs.ll with 100% similarity]
test/DebugInfo/Generic/version.ll [moved from test/DebugInfo/version.ll with 100% similarity]
test/DebugInfo/lit.local.cfg [deleted file]
test/Feature/optnone-llc.ll
test/Feature/optnone.ll
test/LTO/X86/bcsection.ll
test/LTO/X86/current-section.ll
test/LTO/X86/list-symbols.ll
test/Linker/subprogram-linkonce-weak.ll
test/Linker/type-unique-odr-a.ll
test/Linker/type-unique-simple-a.ll
test/Linker/type-unique-simple2-a.ll
test/Linker/type-unique-simple2.ll
test/Linker/type-unique-type-array-a.ll
test/MC/ELF/cfi-version.ll
test/Other/2010-05-06-Printer.ll
test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll
test/lit.cfg
test/tools/llvm-mc/basic.test
test/tools/llvm-mc/fatal_warnings.test
test/tools/llvm-mc/line_end_with_space.test
test/tools/llvm-mc/lit.local.cfg [new file with mode: 0644]
test/tools/llvm-mc/no_warnings.test

index 0917762..6a5ac88 100644 (file)
 /* 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}"
index fee514e..72be4fe 100644 (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 }
 
index f3f03bd..f22d4aa 100644 (file)
@@ -1,3 +1,3 @@
-if 'native' not in config.available_features:
+if not config.target_triple:
     config.unsupported = True
 
index fde3303..d20e3b0 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s
+; REQUIRES: default_triple
 
 define void @iterative_hash_host_wide_int() {
         %zero = alloca i32              ; <i32*> [#uses=2]
index c63fd9a..3d5fa52 100644 (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] }
index 0e77098..c064c27 100644 (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:
index 9660d45..8536dda 100644 (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]
 
index 4830ca6..aa39dfd 100644 (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) {
index 8d1f814..3b46857 100644 (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
index 795d464..609dbc1 100644 (file)
@@ -1,5 +1,6 @@
 ; RUN: llc < %s 
 ; PR933
+; REQUIRES: default_triple
 
 define fastcc i1 @test() {
         ret i1 true
index 8bb3dc6..71a560a 100644 (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:
index 92419fc..e26a860 100644 (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:
index d672117..eb077c0 100644 (file)
@@ -1,4 +1,6 @@
 ; RUN: llc -O1 < %s
+; REQUIRES: default_triple
+
 ; ModuleID = 'pr6157.bc'
 ; formerly crashed in SelectionDAGBuilder
 
index 308d72c..5e565a1 100644 (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]
index 2a505e8..b924e1c 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s
+; REQUIRES: default_triple
 
 
 declare i8* @llvm_gc_allocate(i32)
index b492942..1a390c9 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s -O0
+; REQUIRES: default_triple
 
 define i32 @main() {
 entry:
index c2d418a..8cccd78 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s
+; REQUIRES: default_triple
 
        %Env = type i8*
 
index d1ba9a8..1b04c41 100644 (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
index 9dd8478..87eec3f 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s
+; REQUIRES: default_triple
 
 ; Legalization test that requires scalarizing a vector.
 
diff --git a/test/DebugInfo/Generic/lit.local.cfg b/test/DebugInfo/Generic/lit.local.cfg
new file mode 100644 (file)
index 0000000..f22d4aa
--- /dev/null
@@ -0,0 +1,3 @@
+if not config.target_triple:
+    config.unsupported = True
+
diff --git a/test/DebugInfo/lit.local.cfg b/test/DebugInfo/lit.local.cfg
deleted file mode 100644 (file)
index f3f03bd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-if 'native' not in config.available_features:
-    config.unsupported = True
-
index 544b2ee..015cc84 100644 (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.
index 3cb6efd..7d8afd4 100644 (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.
 
index e65ade6..bcd6bc3 100644 (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
index f79b378..49eee49 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llvm-as < %s >%t1
 ; RUN: llvm-lto -o %t2 %t1
+; REQUIRES: default_triple
 
 module asm ".align 4"
index 41b7d00..1d98b39 100644 (file)
@@ -1,6 +1,7 @@
 ; RUN: llvm-as -o %T/1.bc %s
 ; RUN: llvm-as -o %T/2.bc %S/Inputs/list-symbols.ll
 ; RUN: llvm-lto -list-symbols-only %T/1.bc %T/2.bc | FileCheck %s
+; REQUIRES: default_triple
 
 ; CHECK-LABEL: 1.bc:
 ; CHECK-DAG: foo
index 6330ecc..78a576d 100644 (file)
@@ -1,8 +1,8 @@
-; REQUIRES: native
 ; RUN: llvm-link %s %S/Inputs/subprogram-linkonce-weak.ll -S -o %t1
 ; RUN: FileCheck %s -check-prefix=LW -check-prefix=CHECK <%t1
 ; RUN: llvm-link %S/Inputs/subprogram-linkonce-weak.ll %s -S -o %t2
 ; RUN: FileCheck %s -check-prefix=WL -check-prefix=CHECK <%t2
+; REQUIRES: default_triple
 
 ; This testcase tests the following flow:
 ;  - File A defines a linkonce version of @foo which has inlined into @bar.
index 2030598..7dec860 100644 (file)
@@ -1,4 +1,4 @@
-; REQUIRES: object-emission, native
+; REQUIRES: default_triple, object-emission
 ;
 ; RUN: llvm-link %s %p/type-unique-odr-b.ll -S -o - | %llc_dwarf -dwarf-linkage-names=Enable -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 ;
index a7102e7..5fb0ff2 100644 (file)
@@ -1,4 +1,4 @@
-; REQUIRES: object-emission, native
+; REQUIRES: default_triple, object-emission
 
 ; RUN: llvm-link %s %p/type-unique-simple-b.ll -S -o %t
 ; RUN: cat %t | FileCheck %s -check-prefix=LINK
index e46e716..aeaf708 100644 (file)
@@ -1,4 +1,4 @@
-; REQUIRES: object-emission, native
+; REQUIRES: default_triple, object-emission
 ;
 ; RUN: llvm-link %s %p/type-unique-simple2-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 ;
index d4f398b..7c31cdf 100644 (file)
@@ -1,4 +1,5 @@
-; REQUIRES: object-emission; native
+; REQUIRES: object-emission
+; REQUIRES: default_triple
 
 ; RUN: llvm-link %S/Inputs/type-unique-simple2-a.ll %S/Inputs/type-unique-simple2-b.ll -S -o %t
 ; RUN: cat %t | FileCheck %S/Inputs/type-unique-simple2-a.ll -check-prefix=LINK
index 0004d35..eb4fbd3 100644 (file)
@@ -1,4 +1,4 @@
-; REQUIRES: object-emission, native
+; REQUIRES: default_triple, object-emission
 ;
 ; RUN: llvm-link %s %p/type-unique-type-array-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 ;
index 3449fa6..fc5ea0f 100644 (file)
@@ -4,6 +4,7 @@
 
 ; .debug_frame is not emitted for targeting Windows x64.
 ; REQUIRES: debug_frame
+; REQUIRES: default_triple
 
 ; Function Attrs: nounwind
 define i32 @foo() #0 {
index 6c28b4a..e57b982 100644 (file)
@@ -1,5 +1,5 @@
-; REQUIRES: native
 ; RUN: llc -O2 -print-after-all < %s 2>/dev/null
+; REQUIRES: default_triple
 
 define void @tester(){
   ret void
index 6268c13..43fcc60 100644 (file)
@@ -1,5 +1,6 @@
 ; RUN: opt < %s -O3 | llc -no-integrated-as | FileCheck %s
-; REQUIRES: X86
+; REQUIRES: default_triple
+
 ;; We don't want branch folding to fold asm directives.
 
 ; CHECK: bork_directive
@@ -11,7 +12,7 @@ entry:
        %tmp = icmp eq i32 %param, 0
         br i1 %tmp, label %cond_true, label %cond_false
 
-cond_true:   
+cond_true:
         call void asm sideeffect ".bork_directive /* ${0:c}:${1:c} */", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 37, i32 927 )
         ret void
 
index ace3c2a..914d6b3 100644 (file)
@@ -355,11 +355,15 @@ if config.have_zlib == "1":
 else:
     config.available_features.add("nozlib")
 
-# Native compilation: host arch == target arch and native backend built-in
+# LLVM can be configured with an empty default triple
+# Some tests are "generic" and require a valid default triple
+if config.target_triple:
+    config.available_features.add("default_triple")
+
+# Native compilation: host arch == default triple arch
 # FIXME: Consider cases that target can be executed
 # even if host_triple were different from target_triple.
-if (config.host_triple == config.target_triple and
-    config.native_target in config.targets_to_build):
+if config.host_triple == config.target_triple:
     config.available_features.add("native")
 
 import subprocess
index abdd3b7..cfc372e 100644 (file)
@@ -1,4 +1,4 @@
 # RUN: not llvm-mc %t.blah -o %t2 2>&1 | FileCheck --check-prefix=ENOENT %s
-# REQUIRES: native
+# REQUIRES: default_triple
 
 # ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
index e4dde48..3761ec4 100644 (file)
@@ -1,6 +1,6 @@
 # RUN: not llvm-mc --fatal-warnings %s 2>&1 | FileCheck %s
 # XFAIL: hexagon
-# REQUIRES: native
+# REQUIRES: default_triple
 
 # CHECK: error: .warning directive invoked in source file
 .warning
index 0967d6a..4c365f6 100644 (file)
@@ -1,2 +1,2 @@
 RUN: llvm-mc -disassemble %s
-# REQUIRES: native
+# REQUIRES: default_triple
diff --git a/test/tools/llvm-mc/lit.local.cfg b/test/tools/llvm-mc/lit.local.cfg
new file mode 100644 (file)
index 0000000..f22d4aa
--- /dev/null
@@ -0,0 +1,3 @@
+if not config.target_triple:
+    config.unsupported = True
+
index 031da48..46549c4 100644 (file)
@@ -1,6 +1,6 @@
 # RUN: llvm-mc --no-warn %s 2>&1 | FileCheck %s
 # XFAIL: hexagon
-# REQUIRES: native
+# REQUIRES: default_triple
 
 # CHECK-NOT: warning:
 .warning