* gas/cr16/pic-1.s: New.
authorM R Swami Reddy <MR.Swami.Reddy@nsc.com>
Thu, 27 Nov 2008 11:46:52 +0000 (11:46 +0000)
committerM R Swami Reddy <MR.Swami.Reddy@nsc.com>
Thu, 27 Nov 2008 11:46:52 +0000 (11:46 +0000)
        * 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
gas/testsuite/gas/cr16/pic.exp [new file with mode: 0644]
gas/testsuite/gas/cr16/pic1.d [new file with mode: 0644]
gas/testsuite/gas/cr16/pic1.s [new file with mode: 0644]
gas/testsuite/gas/cr16/pic2.d [new file with mode: 0644]
gas/testsuite/gas/cr16/pic2.s [new file with mode: 0644]

index f95f1e12b6ae30edc9c051024897f81142f5e305..60b8c907cee4add0bd4f71b550337977187a6a05 100644 (file)
@@ -1,3 +1,11 @@
+2008-11-27  M R Swami Reddy  <MR.Swami.Reddy@nsc.com>
+
+       * 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  <hp@axis.com>
 
        * 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 (file)
index 0000000..1e420b6
--- /dev/null
@@ -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 (file)
index 0000000..3e61d98
--- /dev/null
@@ -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 (file)
index 0000000..23f0cc8
--- /dev/null
@@ -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 (file)
index 0000000..deacee4
--- /dev/null
@@ -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 (file)
index 0000000..45b6403
--- /dev/null
@@ -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)