aboutsummaryrefslogtreecommitdiff
path: root/test/MC/ELF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-08-07 23:01:33 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-08-07 23:01:33 +0000
commitee8648bdac07986a0f1ec897b02ec82a2f144d46 (patch)
tree52d1861acda1205241ee35a94aa63129c604d469 /test/MC/ELF
parent1a82d4c088707c791c792f6822f611b47a12bdfe (diff)
downloadsrc-ee8648bdac07986a0f1ec897b02ec82a2f144d46.tar.gz
src-ee8648bdac07986a0f1ec897b02ec82a2f144d46.zip
Vendor import of llvm trunk r242221:vendor/llvm/llvm-trunk-r242221
Notes
Notes: svn path=/vendor/llvm/dist/; revision=286425 svn path=/vendor/llvm/llvm-trunk-r242221/; revision=286426; tag=vendor/llvm/llvm-trunk-r242221
Diffstat (limited to 'test/MC/ELF')
-rw-r--r--test/MC/ELF/relax-arith.s8
-rw-r--r--test/MC/ELF/relax-arith2.s12
-rw-r--r--test/MC/ELF/relax-arith4.s25
3 files changed, 45 insertions, 0 deletions
diff --git a/test/MC/ELF/relax-arith.s b/test/MC/ELF/relax-arith.s
index d4f37a9ddf9f..15e44ebff7ef 100644
--- a/test/MC/ELF/relax-arith.s
+++ b/test/MC/ELF/relax-arith.s
@@ -115,3 +115,11 @@ bar:
cmpl $foo, bar
cmp $foo, %rbx
cmpq $foo, bar
+
+// CHECK: Disassembly of section push:
+// CHECK-NEXT: push:
+// CHECK-NEXT: 0: 66 68 00 00 pushw $0
+// CHECK-NEXT: 4: 68 00 00 00 00 pushq $0
+ .section push,"x"
+ pushw $foo
+ push $foo
diff --git a/test/MC/ELF/relax-arith2.s b/test/MC/ELF/relax-arith2.s
index a6c55adf894b..b05418482e32 100644
--- a/test/MC/ELF/relax-arith2.s
+++ b/test/MC/ELF/relax-arith2.s
@@ -116,3 +116,15 @@ bar:
cmpl $1, bar
cmp $-1, %rbx
cmpq $42, bar
+
+// CHECK: Disassembly of section push:
+// CHECK-NEXT: push:
+// CHECK-NEXT: 0: 66 6a 80 pushw $-128
+// CHECK-NEXT: 3: 66 6a 7f pushw $127
+// CHECK-NEXT: 6: 6a 80 pushq $-128
+// CHECK-NEXT: 8: 6a 7f pushq $127
+ .section push,"x"
+ pushw $-128
+ pushw $127
+ push $-128
+ push $127
diff --git a/test/MC/ELF/relax-arith4.s b/test/MC/ELF/relax-arith4.s
new file mode 100644
index 000000000000..3fd3cadb76ab
--- /dev/null
+++ b/test/MC/ELF/relax-arith4.s
@@ -0,0 +1,25 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | llvm-objdump -d - | FileCheck %s
+
+// Test for proper instruction relaxation behavior for the push $imm
+// instruction forms. This is the 32-bit version of the push $imm tests from
+// relax-arith.s and relax-arith2.s.
+
+// CHECK: Disassembly of section push8:
+// CHECK-NEXT: push8:
+// CHECK-NEXT: 0: 66 6a 80 pushw $-128
+// CHECK-NEXT: 3: 66 6a 7f pushw $127
+// CHECK-NEXT: 6: 6a 80 pushl $-128
+// CHECK-NEXT: 8: 6a 7f pushl $127
+ .section push8,"x"
+ pushw $-128
+ pushw $127
+ push $-128
+ push $127
+
+// CHECK: Disassembly of section push32:
+// CHECK-NEXT: push32:
+// CHECK-NEXT: 0: 66 68 00 00 pushw $0
+// CHECK-NEXT: 4: 68 00 00 00 00 pushl $0
+ .section push32,"x"
+ pushw $foo
+ push $foo