summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_compile/all.T
diff options
context:
space:
mode:
authorZejun Wu <watashi@fb.com>2018-10-15 13:51:24 -0400
committerBen Gamari <ben@smart-cactus.org>2018-10-15 18:34:17 -0400
commit95ec7c88c7223508db3ba91d6ab9e303d0b062ad (patch)
treed249e525aa48e841104e89411b4791f218ff6db5 /testsuite/tests/codeGen/should_compile/all.T
parent02b2116e458357e87718e7378a80579a7021e2a7 (diff)
downloadhaskell-95ec7c88c7223508db3ba91d6ab9e303d0b062ad.tar.gz
Generate correct relocation for external cost centre
We used to always generate direct access for cost centre labels. We fixed this by generating indirect data load for cost centre defined in external module. Test Plan: The added test used to fail with error message ``` /bin/ld.gold: error: T15723B.o: requires dynamic R_X86_64_PC32 reloc against 'T15723A_foo1_EXPR_cc' which may overflow at runtime; recompile with -fPIC ``` and now passes. Also check that `R_X86_64_PC32` is generated for CostCentre from the same module and `R_X86_64_GOTPCREL` is generated for CostCentre from external module: ``` $ objdump -rdS T15723B.o 0000000000000028 <T15723B_test_info>: 28: 48 8d 45 f0 lea -0x10(%rbp),%rax 2c: 4c 39 f8 cmp %r15,%rax 2f: 72 70 jb a1 <T15723B_test_info+0x79> 31: 48 83 ec 08 sub $0x8,%rsp 35: 48 8d 35 00 00 00 00 lea 0x0(%rip),%rsi # 3c <T15723B_test_info+0x14> 38: R_X86_64_PC32 T15723B_test1_EXPR_cc-0x4 3c: 49 8b bd 60 03 00 00 mov 0x360(%r13),%rdi 43: 31 c0 xor %eax,%eax 45: e8 00 00 00 00 callq 4a <T15723B_test_info+0x22> 46: R_X86_64_PLT32 pushCostCentre-0x4 4a: 48 83 c4 08 add $0x8,%rsp 4e: 48 ff 40 30 incq 0x30(%rax) 52: 49 89 85 60 03 00 00 mov %rax,0x360(%r13) 59: 48 83 ec 08 sub $0x8,%rsp 5d: 49 8b bd 60 03 00 00 mov 0x360(%r13),%rdi 64: 48 8b 35 00 00 00 00 mov 0x0(%rip),%rsi # 6b <T15723B_test_info+0x43> 67: R_X86_64_GOTPCREL T15723A_foo1_EXPR_cc-0x4 6b: 31 c0 xor %eax,%eax 6d: e8 00 00 00 00 callq 72 <T15723B_test_info+0x4a> 6e: R_X86_64_PLT32 pushCostCentre-0x4 72: 48 83 c4 08 add $0x8,%rsp 76: 48 ff 40 30 incq 0x30(%rax) ``` Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15723 Differential Revision: https://phabricator.haskell.org/D5214
Diffstat (limited to 'testsuite/tests/codeGen/should_compile/all.T')
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T5
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index a5d5a47034..f8e2fb0033 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -46,3 +46,8 @@ test('T15196',
[ unless(arch('x86_64'),skip),
only_ways('normal'),
], run_command, ['$MAKE -s --no-print-directory T15196'])
+
+test('T15723',
+ [ unless(have_profiling(), skip),
+ unless(have_dynamic(), skip),
+ ], run_command, ['$MAKE -s --no-print-directory T15723'])