Fix another batch of `./validate --slow` failures
authorAlp Mestanogullari <alp@well-typed.com>
Sun, 13 May 2018 22:38:18 +0000 (18:38 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 14 May 2018 02:22:43 +0000 (22:22 -0400)
A rather detailed summary can be found at:

    https://gist.github.com/alpmestan/be82b47bb88b7dc9ff84105af9b1bb82

This doesn't fix all expectation mismatches yet, but we're down to about
20 mismatches with my previous patch and this one, as opposed to ~150
when I got started.

Test Plan: ./validate --slow

Reviewers: bgamari, erikd, simonmar

Reviewed By: simonmar

Subscribers: thomie, carter

GHC Trac Issues: #14890

Differential Revision: https://phabricator.haskell.org/D4636

18 files changed:
testsuite/tests/cabal/cabal01/all.T
testsuite/tests/dependent/should_compile/all.T
testsuite/tests/driver/T3007/all.T
testsuite/tests/driver/all.T
testsuite/tests/ffi/should_fail/all.T
testsuite/tests/indexed-types/should_compile/all.T
testsuite/tests/numeric/should_compile/all.T
testsuite/tests/patsyn/should_compile/T13350/all.T
testsuite/tests/rts/Makefile
testsuite/tests/rts/T5435_asm.c
testsuite/tests/rts/T5435_dyn_asm.stdout
testsuite/tests/rts/T5435_v_asm_a.stdout [new file with mode: 0644]
testsuite/tests/rts/T5435_v_asm_a.stdout-darwin [moved from testsuite/tests/rts/T5435_v_asm.stdout-darwin with 100% similarity]
testsuite/tests/rts/T5435_v_asm_a.stdout-mingw32 [moved from testsuite/tests/rts/T5435_v_asm.stdout-mingw32 with 100% similarity]
testsuite/tests/rts/T5435_v_asm_b.stdout [new file with mode: 0644]
testsuite/tests/rts/all.T
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_run/all.T

index 8da74f5..9bf2eb1 100644 (file)
@@ -24,5 +24,5 @@ def ignoreLdOutput(str):
 test('cabal01',
      [extra_files(['A.hs', 'B/', 'MainA.hs', 'Setup.lhs', 'c_src/', 'hello.c', 'test.cabal']),
       normalise_errmsg_fun(ignoreLdOutput)],
-     run_command, 
+     run_command,
      ['$MAKE -s --no-print-directory cabal01 VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn + ' ' + cleanup])
index 5874d2e..6585316 100644 (file)
@@ -10,7 +10,14 @@ test('RaeBlogPost', normal, compile, [''])
 test('mkGADTVars', normal, compile, [''])
 test('TypeLevelVec',normal,compile, [''])
 test('T9632', normal, compile, [''])
-test('dynamic-paper', normal, compile, ['']) # see #11330
+# The dynamic-paper test fails in the profasm way if we don't increase
+# the simplifier tick limit. If we do, we run out of stack
+# space. If we increase the stack size enough with -K,
+# we run out of simplifier ticks again. This is
+# discussed in #11330.
+test('dynamic-paper',
+     expect_broken_for(11330, ['profasm']),
+     compile, [''])
 test('T11311', normal, compile, [''])
 test('T11405', normal, compile, [''])
 test('T11241', normal, compile, [''])
index bd9046c..803357b 100644 (file)
@@ -1 +1,4 @@
-test('T3007', [extra_files(['A/', 'B/'])], run_command, ['$MAKE -s --no-print-directory T3007'])
+test('T3007',
+     extra_files(['A/', 'B/']),
+     run_command,
+     ['$MAKE -s --no-print-directory T3007'])
index ba177c1..714b6c4 100644 (file)
@@ -273,4 +273,8 @@ test('json', normal, compile_fail, ['-ddump-json'])
 test('json2', normal, compile, ['-ddump-types -ddump-json'])
 test('T13604', [], run_command, ['$MAKE -s --no-print-directory T13604'])
 test('T13604a', [], run_command, ['$MAKE -s --no-print-directory T13604a'])
-test('inline-check', normal, compile, ['-dinline-check foo -O -ddebug-output'])
+# omitting hpc and profasm because they affect the
+# inlining and unfoldings
+test('inline-check', omit_ways(['hpc', 'profasm'])
+                   , compile
+                  , ['-dinline-check foo -O -ddebug-output'])
index 944f172..ce72f17 100644 (file)
@@ -14,7 +14,15 @@ test('T5664', normal, compile_fail, ['-v0'])
 test('T7506', normal, compile_fail, [''])
 test('T7243', normal, compile_fail, [''])
 test('T10461', normal, compile_fail, [''])
-test('UnsafeReenter', [omit_ways(['ghciext', 'ghci']), exit_code(1)], compile_and_run, ['-v0 UnsafeReenterC.c'])
+
+# UnsafeReenter seems to just hang instead of erroring out
+# with the threaded1, threaded2 and profthreaded ways,
+# see #14912.
+test('UnsafeReenter',
+     [omit_ways(['ghciext', 'ghci']),
+      exit_code(1),
+      expect_broken_for(14912, ['threaded1', 'threaded2', 'profthreaded'])
+     ], compile_and_run, ['-v0 UnsafeReenterC.c'])
 test('UnsafeReenterGhci',
      [exit_code(1), extra_files(['UnsafeReenter.hs', 'UnsafeReenterC.c']), expect_broken(13730)],
      run_command,
index 1a5e5d4..6074a35 100644 (file)
@@ -192,8 +192,14 @@ test('T7489', normal, compile, [''])
 test('T7585', normal, compile, [''])
 test('T7282', normal, compile, [''])
 test('T7804', normal, compile, [''])
-test('T7837', expect_broken_for(9406, prof_ways), compile,
+
+# This test has sometimes been marked as
+# expect_broken_for(9406, prof_ways),
+# so ticket #9406 can be used to track
+# future failures as well.
+test('T7837', normal, compile,
      ['-O -ddump-rule-firings'])
+
 test('T4185', normal, compile, [''])
 
 # Caused infinite loop in the compiler
index 56e319f..e7bc4c6 100644 (file)
@@ -1,5 +1,8 @@
 test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116'])
 test('T7895', normal, compile, [''])
 test('T7881', normal, compile, [''])
+# For T8542, the hpc way adds extra annotations that prevent
+# the appropriate expression to be detected, after
+# desugaring, so we don't get the warning we expect.
 test('T8542', omit_ways(['hpc']), compile, [''])
 test('T10929', normal, compile, [''])
index fa63e37..e8d82a7 100644 (file)
@@ -1,4 +1,6 @@
 # Test that importing COMPLETE sets from external packages works
 
-test('T13350', extra_files(['T13350.hs', 'boolean']), run_command,
+test('T13350',
+     extra_files(['T13350.hs', 'boolean']),
+     run_command,
      ['$MAKE -s --no-print-directory T13350'])
index 6305085..5077f32 100644 (file)
@@ -64,7 +64,7 @@ T9405:
 
 define run_T5435_v
 $(RM) T5435_load_v_$(1) T5435_v_$(1)$(exeext)
-'$(TEST_HC)' $(TEST_HC_OPTS) -optc-D$(HostOS)_HOST_OS -v0 -c T5435_$(1).c -o T5435_load_v_$(1).o
+'$(TEST_HC)' $(TEST_HC_OPTS) -optc-D$(HostOS)_HOST_OS -optc-DLOAD_CONSTR=$(2) -v0 -c T5435_$(1).c -o T5435_load_v_$(1).o
 '$(TEST_HC)' $(TEST_HC_OPTS) -v0 T5435.hs -osuf main_v_$(1)_o -o T5435_v_$(1)$(exeext)
 ./T5435_v_$(1) v ./T5435_load_v_$(1).o
 endef
@@ -78,11 +78,13 @@ endef
 
 .PHONY: T5435_v_gcc
 T5435_v_gcc :
-       $(call run_T5435_v,gcc)
+       $(call run_T5435_v,gcc,0)
 
-.PHONY: T5435_v_asm
-T5435_v_asm :
-       $(call run_T5435_v,asm)
+.PHONY: T5435_v_asm_a T5435_v_asm_b
+T5435_v_asm_a :
+       $(call run_T5435_v,asm,0)
+T5435_v_asm_b :
+       $(call run_T5435_v,asm,1)
 
 .PHONY: T5435_dyn_gcc
 T5435_dyn_gcc :
index 59b53b1..90813aa 100644 (file)
@@ -33,17 +33,19 @@ static void (*mod_init_func[2])(void) __attribute__((
 
 #else /* ELF */
 
+#if LOAD_CONSTR == 0
 static void (*const init_array[2])(void) __attribute__((
             section(".init_array"), // put it in the right section
             used,                   // prevent GCC from optimizing this away
             aligned(sizeof(void*))  // avoid slop between GCC's preloaded initializers and ours
             ))
     = {initArray1, initArray2};
-
+#else
 static void (*ctors[2])(void) __attribute__((
             section(".ctors"),
             used,
             aligned(sizeof(void*))))
     = {ctors2, ctors1}; // ctors run in reverse
+#endif
 
 #endif
diff --git a/testsuite/tests/rts/T5435_v_asm_a.stdout b/testsuite/tests/rts/T5435_v_asm_a.stdout
new file mode 100644 (file)
index 0000000..3124fa8
--- /dev/null
@@ -0,0 +1,3 @@
+initArray1
+initArray2
+success
\ No newline at end of file
diff --git a/testsuite/tests/rts/T5435_v_asm_b.stdout b/testsuite/tests/rts/T5435_v_asm_b.stdout
new file mode 100644 (file)
index 0000000..318d66e
--- /dev/null
@@ -0,0 +1,3 @@
+ctors1
+ctors2
+success
\ No newline at end of file
index 8fa2257..a07179a 100644 (file)
@@ -174,14 +174,7 @@ def checkDynAsm(actual_file, normaliser):
     actual_raw = read_no_crs(actual_file)
     actual_str = normaliser(actual_raw)
     actual = actual_str.split()
-    if actual == ['initArray1', 'initArray2', 'ctors1', 'ctors2', 'success']:
-        return 1
-    elif actual == ['initArray1', 'initArray2', 'ctors2', 'ctors1', 'success']:
-        # gold seems to produce this ordering; this is slightly odd but if it's
-        # wrong it's not our fault. See #13883.
-        return 1
-    elif actual == ['ctors1', 'ctors2', 'initArray1', 'initArray2', 'success']:
-        if_verbose(1, 'T5435_dyn_asm detected old-style dlopen, see #8458')
+    if actual == ['initArray1', 'initArray2', 'success']:
         return 1
     elif opsys('darwin') and actual == ['modInitFunc1', 'modInitFunc2', 'success']:
         return 1
@@ -191,13 +184,22 @@ def checkDynAsm(actual_file, normaliser):
         if_verbose(1, 'T5435_dyn_asm failed with %s, see all.T for details' % actual)
         return 0
 
+# T5435_v_asm got split into two tests because depending
+# on the linker, .init_array and .ctors sections are loaded
+# in a different order (but all entries within a section
+# do get loaded in a deterministic order). So we test each
+# separately now.
 # These should have extra_clean() arguments, but I need
 # to somehow extract out the name of DLLs to do that
-
-test('T5435_v_asm', [extra_files(['T5435.hs', 'T5435_asm.c']),
+test('T5435_v_asm_a', [extra_files(['T5435.hs', 'T5435_asm.c']),
                      when(arch('powerpc64') or arch('powerpc64le'),
                           expect_broken(11259))],
-     run_command, ['$MAKE -s --no-print-directory T5435_v_asm'])
+     run_command, ['$MAKE -s --no-print-directory T5435_v_asm_a'])
+# this one just needs to run on linux, as darwin/mingw32 are covered
+# by the _a test already.
+test('T5435_v_asm_b', [extra_files(['T5435.hs', 'T5435_asm.c']),
+                     when(opsys('darwin') or opsys('mingw32'), skip)],
+     run_command, ['$MAKE -s --no-print-directory T5435_v_asm_b'])
 test('T5435_v_gcc', [extra_files(['T5435.hs', 'T5435_gcc.c']),
                      when(arch('powerpc64') or arch('powerpc64le'),
                           expect_broken(11259))],
@@ -382,7 +384,12 @@ test('T12497', [ unless(opsys('mingw32'), skip)
                ],
                run_command, ['$MAKE -s --no-print-directory T12497'])
 
-test('T12903', [when(opsys('mingw32'), skip)], compile_and_run, [''])
+test('T12903', [ when(opsys('mingw32'), skip)
+               # produces out of sequence samples in the profasm way
+              , expect_broken_for(15065, ['profasm'])
+              , omit_ways(['ghci'])
+              ], compile_and_run, [''])
+
 test('T13832', exit_code(1), compile_and_run, ['-threaded'])
 test('T13894', normal, compile_and_run, [''])
 test('T14497', normal, compile_and_run, ['-O'])
index 6a680f6..f4f48d2 100644 (file)
@@ -591,7 +591,11 @@ test('MissingExportList01', normal, compile, [''])
 test('MissingExportList02', normal, compile, [''])
 test('T14488', normal, compile, [''])
 test('T14590', normal, compile, ['-fdefer-type-errors -fno-max-valid-substitutions'])
-test('T13032', omit_ways(['hpc']), compile, [''])
+# We omit the hpc/profasm ways because this test checks the
+# desugarer's output and these ways add some
+# annotations/ticks that prevent it from giving the exact
+# output we expect (T13032.stderr).
+test('T13032', omit_ways(['hpc', 'profasm']), compile, [''])
 test('T14273', normal, compile, ['-fdefer-type-errors -fno-max-valid-substitutions'])
 test('T14732', normal, compile, [''])
 test('T14774', [], run_command, ['$MAKE -s --no-print-directory T14774'])
index c4eb3df..3cf70b6 100755 (executable)
@@ -114,9 +114,16 @@ test('TypeOf', normal, compile_and_run, [''])
 test('TypeRep', normal, compile_and_run, [''])
 test('T11120', normal, compile_and_run, [''])
 test('KindInvariant', normal, ghci_script, ['KindInvariant.script'])
+
+# We omit the ghci way in these 3 tests because they use
+# unboxed sums and ghci does not support those yet.
 test('StrictPats', omit_ways(['ghci']), compile_and_run, [''])
 test('T12809', omit_ways(['ghci']), compile_and_run, [''])
-test('EtaExpandLevPoly', omit_ways(['ghci']), compile_and_run, [''])
+test('EtaExpandLevPoly', [ omit_ways(['ghci'])
+                         # triggers a core lint error in profiled ways
+                        , expect_broken_for(15066, ['profasm', 'profthreaded'])
+                        ], compile_and_run, [''])
+
 test('TestTypeableBinary', normal, compile_and_run, [''])
 test('Typeable1', normal, compile_fail, [''])
 test('TypeableEq', normal, compile_and_run, [''])