This is an archive of the discontinued LLVM Phabricator instance.

ARM: Additional test files for thumb fixups
ClosedPublic

Authored by cpirker on May 8 2014, 8:20 AM.

Details

Reviewers
jmolloy
Summary

Hi,

I added test files to the patch D3380 (already committed as rL208076).

Thanks,
Christian

Diff Detail

Event Timeline

cpirker updated this revision to Diff 9225.May 8 2014, 8:20 AM
cpirker retitled this revision from to ARM: Additional test files for thumb fixups.
cpirker updated this object.
cpirker edited the test plan for this revision. (Show Details)
cpirker added a subscriber: Unknown Object (MLST).
jmolloy requested changes to this revision.May 13 2014, 5:12 AM
jmolloy added a reviewer: jmolloy.
jmolloy added a subscriber: jmolloy.

Hi Christian,

The canonical way to write these tests is to use llvm-mc -show-encoding, as opposed to piping ELF output through llvm-objdump. As an example, take a look at test/MC/ARM/thumb-neon-crypto.s.

Cheers,

James

This revision now requires changes to proceed.May 13 2014, 5:12 AM
cpirker updated this revision to Diff 9357.May 13 2014, 10:07 AM
cpirker edited edge metadata.

Hi James,

I modified the test files as you requested.

Thanks,
Christian

Hi Christian,

OK, LGTM. Thanks!

James

-----Original Message-----
From: Christian Pirker [mailto:cpirker@a-bix.com]
Sent: 13 May 2014 18:07
To: cpirker@a-bix.com; James Molloy
Cc: Amara Emerson; llvm-commits@cs.uiuc.edu; t.p.northover@gmail.com
Subject: Re: [PATCH] ARM: Additional test files for thumb fixups

Hi James,

I modified the test files as you requested.

Thanks,
Christian

http://reviews.llvm.org/D3679

Files:

test/MC/ARM/thumb2be-b.w-encoding.s
test/MC/ARM/thumb2be-beq.w-encoding.s
test/MC/ARM/thumb2be-movt-encoding.s
test/MC/ARM/thumb2be-movw-encoding.s

Index: test/MC/ARM/thumb2be-b.w-encoding.s

  • test/MC/ARM/thumb2be-b.w-encoding.s

+++ test/MC/ARM/thumb2be-b.w-encoding.s
@@ -1,12 +1,9 @@
- RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumb -s - | FileCheck %s --check-
prefix=CHECK-LE
-
RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumbeb -s - | FileCheck %s --check-
prefix=CHECK-BE

  • .syntax unified
  • .code 16
  • .thumb_func

-foo:

  • b.w bar

+@ RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -show-encoding < %s

FileCheck %s --check-prefix=CHECK-LE

+@ RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -show-encoding <
%s | FileCheck %s --check-prefix=CHECK-BE

- CHECK-LE: Contents of section .text:
-
CHECK-LE-NEXT: 0000 fff7febf
- CHECK-BE: Contents of section .text:
-
CHECK-BE-NEXT: 0000 f7ffbffe
+b.w bar
+@ CHECK-LE: b.w bar @ encoding: [A,0xf0'A',A,0x90'A']
+@ CHECK-LE-NEXT: @ fixup A - offset: 0, value: bar, kind:
fixup_t2_uncondbranch
+@ CHECK-BE: b.w bar @ encoding: [0xf0'A',A,0x90'A',A]
+@ CHECK-BE-NEXT: @ fixup A - offset: 0, value: bar, kind:
fixup_t2_uncondbranch
+

Index: test/MC/ARM/thumb2be-beq.w-encoding.s

  • test/MC/ARM/thumb2be-beq.w-encoding.s

+++ test/MC/ARM/thumb2be-beq.w-encoding.s
@@ -1,12 +1,9 @@
- RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumb -s - | FileCheck %s --check-
prefix=CHECK-LE
-
RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumbeb -s - | FileCheck %s --check-
prefix=CHECK-BE

  • .syntax unified
  • .code 16
  • .thumb_func

-foo:

  • beq.w bar

+@ RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -show-encoding < %s

FileCheck %s --check-prefix=CHECK-LE

+@ RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -show-encoding <
%s | FileCheck %s --check-prefix=CHECK-BE

- CHECK-LE: Contents of section .text:
-
CHECK-LE-NEXT: 0000 3ff4feaf
- CHECK-BE: Contents of section .text:
-
CHECK-BE-NEXT: 0000 f43faffe
+beq.w bar
+@ CHECK-LE: beq.w bar @ encoding: [A,0xf0'A',A,0x80'A']
+@ CHECK-LE-NEXT: @ fixup A - offset: 0, value: bar, kind:
fixup_t2_condbranch
+@ CHECK-BE: beq.w bar @ encoding: [0xf0'A',A,0x80'A',A]
+@ CHECK-BE-NEXT: @ fixup A - offset: 0, value: bar, kind:
fixup_t2_condbranch
+

Index: test/MC/ARM/thumb2be-movt-encoding.s

  • test/MC/ARM/thumb2be-movt-encoding.s

+++ test/MC/ARM/thumb2be-movt-encoding.s
@@ -1,12 +1,9 @@
- RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumb -s - | FileCheck %s --check-
prefix=CHECK-LE
-
RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumbeb -s - | FileCheck %s --check-
prefix=CHECK-BE

  • .syntax unified
  • .code 16
  • .thumb_func

-foo:

  • movt r9, :upper16:(_bar)

+@ RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -show-encoding < %s

FileCheck %s --check-prefix=CHECK-LE

+@ RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -show-encoding <
%s | FileCheck %s --check-prefix=CHECK-BE

- CHECK-LE: Contents of section .text:
-
CHECK-LE-NEXT: 0000 c0f20009
- CHECK-BE: Contents of section .text:
-
CHECK-BE-NEXT: 0000 f2c00900
+movt r9, :upper16:(_bar)
+@ CHECK-LE: movt r9, :upper16:_bar @ encoding:
[0xc0'A',0xf2'A',0b0000AAAA,0x09]
+@ CHECK-LE-NEXT: @ fixup A - offset: 0, value: _bar, kind:
fixup_t2_movt_hi16
+@ CHECK-BE: movt r9, :upper16:_bar @ encoding:
[0xf2,0b1100AAAA,0x09'A',A]
+@ CHECK-BE-NEXT: @ fixup A - offset: 0, value: _bar, kind:
fixup_t2_movt_hi16
+

Index: test/MC/ARM/thumb2be-movw-encoding.s

  • test/MC/ARM/thumb2be-movw-encoding.s

+++ test/MC/ARM/thumb2be-movw-encoding.s
@@ -1,12 +1,9 @@
- RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumb -s - | FileCheck %s --check-
prefix=CHECK-LE
-
RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -mcpu=cortex-a8 -
filetype=obj < %s | llvm-objdump -arch=thumbeb -s - | FileCheck %s --check-
prefix=CHECK-BE

  • .syntax unified
  • .code 16
  • .thumb_func

-foo:

  • movw r9, :lower16:(_bar)

+@ RUN: llvm-mc -triple=thumbv7-none-linux-gnueabi -show-encoding < %s

FileCheck %s --check-prefix=CHECK-LE

+@ RUN: llvm-mc -triple=thumbebv7-none-linux-gnueabi -show-encoding <
%s | FileCheck %s --check-prefix=CHECK-BE

- CHECK-LE: Contents of section .text:
-
CHECK-LE-NEXT: 0000 40f20009
- CHECK-BE: Contents of section .text:
-
CHECK-BE-NEXT: 0000 f2400900
+movw r9, :lower16:(_bar)
+@ CHECK-LE: movw r9, :lower16:_bar @ encoding:
[0x40'A',0xf2'A',0b0000AAAA,0x09]
+@ CHECK-LE-NEXT: @ fixup A - offset: 0, value: _bar, kind:
fixup_t2_movw_lo16
+@ CHECK-BE: movw r9, :lower16:_bar @ encoding:
[0xf2,0b0100AAAA,0x09'A',A]
+@ CHECK-BE-NEXT: @ fixup A - offset: 0, value: _bar, kind:
fixup_t2_movw_lo16
+

Hi James,

I committed this patch as rL208712.

Thanks,
Christian

rengolin accepted this revision.May 14 2014, 1:03 AM
rengolin resigned from this revision.
rengolin added a reviewer: rengolin.
rengolin removed a reviewer: rengolin.
jmolloy accepted this revision.May 14 2014, 10:15 AM
jmolloy edited edge metadata.
This revision is now accepted and ready to land.May 14 2014, 10:15 AM
cpirker closed this revision.May 14 2014, 10:17 AM