Change '{if,unless}_arch' to 'arch'
authorIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 14:03:23 +0000 (14:03 +0000)
committerIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 14:03:23 +0000 (14:03 +0000)
testsuite/driver/testlib.py
testsuite/tests/codeGen/should_compile/all.T
testsuite/tests/codeGen/should_run/all.T
testsuite/tests/ffi/should_run/all.T

index b9104fc..02c7ba3 100644 (file)
@@ -322,17 +322,8 @@ def platform( plat ):
 def opsys( os ):
     return config.os == os
 
-def if_arch( arch, f ):
-    if config.arch == arch:
-        return f
-    else:
-        return normal
-
-def unless_arch( arch, f ):
-    if config.arch == arch:
-        return normal
-    else:
-        return f
+def arch( arch ):
+    return config.arch == arch
 
 def wordsize( ws ):
     return config.wordsize == str(ws)
index 046d98e..220ff85 100644 (file)
@@ -15,8 +15,8 @@ test('T3286', extra_clean(['T3286b.o','T3286b.hi']),
 test('T3579', normal, compile, [''])
 test('T2578', normal, run_command, ['$MAKE -s --no-print-directory T2578'])
 # skip llvm on i386 as we don't support fPIC
-test('jmp_tbl', if_arch('i386', omit_ways(['llvm', 'optllvm'])), compile, ['-fPIC -O'])
+test('jmp_tbl', when(arch('i386'), omit_ways(['llvm', 'optllvm'])), compile, ['-fPIC -O'])
 test('massive_array',
-     [ if_arch('i386', omit_ways(['llvm', 'optllvm'])) ],
+     [ when(arch('i386'), omit_ways(['llvm', 'optllvm'])) ],
      compile, ['-fPIC'])
 test('T7237', normal, compile, [''])
index 77224a2..d470d7b 100644 (file)
@@ -87,7 +87,7 @@ test('T5149', omit_ways(['ghci']), multi_compile_and_run,
                  ['T5149', [('T5149_cmm.cmm', '')], ''])
 test('T5129', normal, compile_and_run, [''])
 test('T5626', exit_code(1), compile_and_run, [''])
-test('T5747', if_arch('i386', extra_hc_opts('-msse2')), compile_and_run, ['-O2'])
+test('T5747', when(arch('i386'), extra_hc_opts('-msse2')), compile_and_run, ['-O2'])
 test('T5785', normal, compile_and_run, [''])
 test('setByteArray', normal, compile_and_run, [''])
 
index 09e6944..a8d62ff 100644 (file)
@@ -32,7 +32,7 @@ test('ffi004', skip, compile_and_run, [''])
 # use of 80-bit internal precision when using the native code generator.
 #
 test('ffi005', [ omit_ways(prof_ways), 
-                 if_arch('i386', skip),
+                 when(arch('i386'), skip),
                  when(platform('i386-apple-darwin'), expect_broken(4105)),
                  exit_code(3) ],
                compile_and_run, [''])