summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts
diff options
context:
space:
mode:
authorAlp Mestanogullari <alp@well-typed.com>2018-05-13 18:38:18 -0400
committerBen Gamari <ben@smart-cactus.org>2018-05-13 22:22:43 -0400
commitca3d3039386b145ae2835ca563b4c5a3497c25c9 (patch)
tree1c72f0eb51238d512de1e9f5989d7c3fc5ade1b9 /testsuite/tests/rts
parent8f3c149d94814e4f278b08c562f06fc257eb3c43 (diff)
downloadhaskell-ca3d3039386b145ae2835ca563b4c5a3497c25c9.tar.gz
Fix another batch of `./validate --slow` failures
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
Diffstat (limited to 'testsuite/tests/rts')
-rw-r--r--testsuite/tests/rts/Makefile12
-rw-r--r--testsuite/tests/rts/T5435_asm.c4
-rw-r--r--testsuite/tests/rts/T5435_dyn_asm.stdout2
-rw-r--r--testsuite/tests/rts/T5435_v_asm_a.stdout3
-rw-r--r--testsuite/tests/rts/T5435_v_asm_a.stdout-darwin (renamed from testsuite/tests/rts/T5435_v_asm.stdout-darwin)0
-rw-r--r--testsuite/tests/rts/T5435_v_asm_a.stdout-mingw32 (renamed from testsuite/tests/rts/T5435_v_asm.stdout-mingw32)0
-rw-r--r--testsuite/tests/rts/T5435_v_asm_b.stdout3
-rw-r--r--testsuite/tests/rts/all.T31
8 files changed, 35 insertions, 20 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 630508542d..5077f325c1 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -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 :
diff --git a/testsuite/tests/rts/T5435_asm.c b/testsuite/tests/rts/T5435_asm.c
index 59b53b1c3e..90813aa839 100644
--- a/testsuite/tests/rts/T5435_asm.c
+++ b/testsuite/tests/rts/T5435_asm.c
@@ -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_dyn_asm.stdout b/testsuite/tests/rts/T5435_dyn_asm.stdout
index 1893d0f56a..429c314309 100644
--- a/testsuite/tests/rts/T5435_dyn_asm.stdout
+++ b/testsuite/tests/rts/T5435_dyn_asm.stdout
@@ -1,5 +1,3 @@
initArray1
initArray2
-ctors1
-ctors2
success
diff --git a/testsuite/tests/rts/T5435_v_asm_a.stdout b/testsuite/tests/rts/T5435_v_asm_a.stdout
new file mode 100644
index 0000000000..3124fa8559
--- /dev/null
+++ b/testsuite/tests/rts/T5435_v_asm_a.stdout
@@ -0,0 +1,3 @@
+initArray1
+initArray2
+success \ No newline at end of file
diff --git a/testsuite/tests/rts/T5435_v_asm.stdout-darwin b/testsuite/tests/rts/T5435_v_asm_a.stdout-darwin
index 8827792585..8827792585 100644
--- a/testsuite/tests/rts/T5435_v_asm.stdout-darwin
+++ b/testsuite/tests/rts/T5435_v_asm_a.stdout-darwin
diff --git a/testsuite/tests/rts/T5435_v_asm.stdout-mingw32 b/testsuite/tests/rts/T5435_v_asm_a.stdout-mingw32
index 293bd12fb0..293bd12fb0 100644
--- a/testsuite/tests/rts/T5435_v_asm.stdout-mingw32
+++ b/testsuite/tests/rts/T5435_v_asm_a.stdout-mingw32
diff --git a/testsuite/tests/rts/T5435_v_asm_b.stdout b/testsuite/tests/rts/T5435_v_asm_b.stdout
new file mode 100644
index 0000000000..318d66e12b
--- /dev/null
+++ b/testsuite/tests/rts/T5435_v_asm_b.stdout
@@ -0,0 +1,3 @@
+ctors1
+ctors2
+success \ No newline at end of file
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 8fa2257b1c..a07179a4df 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -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'])