From 50e9934812fd3b3145eda37ae13a7d86afe6180d Mon Sep 17 00:00:00 2001 From: M R Swami Reddy Date: Thu, 27 Nov 2008 11:46:52 +0000 Subject: [PATCH] * gas/cr16/pic-1.s: New. * gas/cr16/pic-1.d: New. * gas/cr16/pic-2.s: New. * gas/cr16/pic-2.d: New. * gas/cr16/pic.exp: Run pic tests. --- gas/testsuite/ChangeLog | 8 ++++++++ gas/testsuite/gas/cr16/pic.exp | 6 ++++++ gas/testsuite/gas/cr16/pic1.d | 18 ++++++++++++++++++ gas/testsuite/gas/cr16/pic1.s | 23 +++++++++++++++++++++++ gas/testsuite/gas/cr16/pic2.d | 18 ++++++++++++++++++ gas/testsuite/gas/cr16/pic2.s | 23 +++++++++++++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 gas/testsuite/gas/cr16/pic.exp create mode 100644 gas/testsuite/gas/cr16/pic1.d create mode 100644 gas/testsuite/gas/cr16/pic1.s create mode 100644 gas/testsuite/gas/cr16/pic2.d create mode 100644 gas/testsuite/gas/cr16/pic2.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index f95f1e1..60b8c90 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2008-11-27 M R Swami Reddy + + * gas/cr16/pic-1.s: New. + * gas/cr16/pic-1.d: New. + * gas/cr16/pic-2.s: New. + * gas/cr16/pic-2.d: New. + * gas/cr16/pic.exp: Run pic tests. + 2008-11-19 Hans-Peter Nilsson * gas/cris/rd-tls-1.d, gas/cris/rd-tls-1.s: Use a local thread diff --git a/gas/testsuite/gas/cr16/pic.exp b/gas/testsuite/gas/cr16/pic.exp new file mode 100644 index 0000000..1e420b6 --- /dev/null +++ b/gas/testsuite/gas/cr16/pic.exp @@ -0,0 +1,6 @@ +# CR16 PIC testcases (ie for pic and PIC) + +if [istarget cr16*-*] { + run_dump_test "pic1" + run_dump_test "pic2" +} diff --git a/gas/testsuite/gas/cr16/pic1.d b/gas/testsuite/gas/cr16/pic1.d new file mode 100644 index 0000000..3e61d98 --- /dev/null +++ b/gas/testsuite/gas/cr16/pic1.d @@ -0,0 +1,18 @@ +#as: +#objdump: -dr +#name: pic1 + +.*: +file format .* + +Disassembly of section .text: + +00000000 <_main>: + 0: 70 00 00 00 movd \$0x0:l,\(r1,r0\) + 4: 00 00 + 0: R_CR16_IMM32 _text_pointer + 6: 70 00 00 00 movd \$0x0:l,\(r1,r0\) + a: 00 00 + 6: R_CR16_IMM32a _text_address_1 + +0000000c <_text_address_1>: + c: ee 0a jump \(ra\) diff --git a/gas/testsuite/gas/cr16/pic1.s b/gas/testsuite/gas/cr16/pic1.s new file mode 100644 index 0000000..23f0cc8 --- /dev/null +++ b/gas/testsuite/gas/cr16/pic1.s @@ -0,0 +1,23 @@ + .section .text + .globl _text_pointer + .section .data.rel + .type _text_pointer, @object +_text_pointer: + .long _text_address@c + .section .text + .globl _main + .type _main, @function +_main: + ###################### + # Data symbols + ###################### + movd $_text_pointer@l, (r1,r0) + ###################### + # Code symbol with cpic + ###################### + movd $_text_address_1@cpic, (r1,r0) + + .globl _text_address_1 + .type _text_address_1, @function +_text_address_1: + jump (ra) diff --git a/gas/testsuite/gas/cr16/pic2.d b/gas/testsuite/gas/cr16/pic2.d new file mode 100644 index 0000000..deacee4 --- /dev/null +++ b/gas/testsuite/gas/cr16/pic2.d @@ -0,0 +1,18 @@ +#as: +#objdump: -dr +#name: pic2 + +.*: +file format .* + +Disassembly of section .text: + +00000000 <_main>: + 0: 12 00 0c 90 loadd 0x0:l\(r12\),\(r1,r0\) + 4: 00 00 + 0: R_CR16_GOT_REGREL20 _text_pointer + 6: 12 00 0c 90 loadd 0x0:l\(r12\),\(r1,r0\) + a: 00 00 + 6: R_CR16_GOTC_REGREL20 _text_address_1 + +0000000c <_text_address_1>: + c: ee 0a jump \(ra\) diff --git a/gas/testsuite/gas/cr16/pic2.s b/gas/testsuite/gas/cr16/pic2.s new file mode 100644 index 0000000..45b6403 --- /dev/null +++ b/gas/testsuite/gas/cr16/pic2.s @@ -0,0 +1,23 @@ + .section .text + .globl _text_pointer + .section .data.rel + .type _text_pointer, @object +_text_pointer: + .long _text_address@c + .section .text + .globl _main + .type _main, @function +_main: + ###################### + # Data symbol with GOT + ###################### + loadd _text_pointer@GOT(r12), (r1,r0) + ###################### + # Code symbol with cGOT + ###################### + loadd _text_address_1@cGOT(r12), (r1,r0) + + .globl _text_address_1 + .type _text_address_1, @function +_text_address_1: + jump (ra) -- 2.7.4