aboutsummaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-09-11 16:45:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-09-11 16:45:15 +0000
commitb98ac2a71e55e685efa0fdbebdffb5228f7a512d (patch)
treef465f442732805a1655aa054451bd778d9105e29 /test/MC
parentdfa3c9d98260f899297c11cda2b15dc44fc4f91e (diff)
Add support for leb128 of absolute expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/ELF/dg.exp2
-rw-r--r--test/MC/ELF/sleb.s29
-rw-r--r--test/MC/ELF/uleb.s22
3 files changed, 52 insertions, 1 deletions
diff --git a/test/MC/ELF/dg.exp b/test/MC/ELF/dg.exp
index 7b7bd4e738..d46d700975 100644
--- a/test/MC/ELF/dg.exp
+++ b/test/MC/ELF/dg.exp
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,s}]]
}
diff --git a/test/MC/ELF/sleb.s b/test/MC/ELF/sleb.s
new file mode 100644
index 0000000000..ed656b6755
--- /dev/null
+++ b/test/MC/ELF/sleb.s
@@ -0,0 +1,29 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -n %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_32 %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -n %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_64 %s
+// RUN: llvm-mc -filetype=obj -triple i386-apple-darwin9 %s -o - | macho-dump --dump-section-data | FileCheck -check-prefix=MACHO_32 %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-apple-darwin9 %s -o - | macho-dump --dump-section-data | FileCheck -check-prefix=MACHO_64 %s
+
+ .text
+foo:
+ .sleb128 0
+ .sleb128 1
+ .sleb128 -1
+ .sleb128 63
+ .sleb128 -64
+
+ .sleb128 64
+ .sleb128 -65
+
+ .sleb128 8191
+ .sleb128 -8192
+
+ .sleb128 8193
+
+// ELF_32: ('sh_name', 1) # '.text'
+// ELF_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000')
+// ELF_64: ('sh_name', 1) # '.text'
+// ELF_64: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000')
+// MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// MACHO_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000')
+// MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// MACHO_64: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000')
diff --git a/test/MC/ELF/uleb.s b/test/MC/ELF/uleb.s
new file mode 100644
index 0000000000..1fb2a2347a
--- /dev/null
+++ b/test/MC/ELF/uleb.s
@@ -0,0 +1,22 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -n %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_32 %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -n %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_64 %s
+// RUN: llvm-mc -filetype=obj -triple i386-apple-darwin9 %s -o - | macho-dump --dump-section-data | FileCheck -check-prefix=MACHO_32 %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-apple-darwin9 %s -o - | macho-dump --dump-section-data | FileCheck -check-prefix=MACHO_64 %s
+
+ .text
+foo:
+ .uleb128 0
+ .uleb128 1
+ .uleb128 127
+ .uleb128 128
+ .uleb128 16383
+ .uleb128 16384
+
+// ELF_32: ('sh_name', 1) # '.text'
+// ELF_32: ('_section_data', '00017f80 01ff7f80 8001')
+// ELF_64: ('sh_name', 1) # '.text'
+// ELF_64: ('_section_data', '00017f80 01ff7f80 8001')
+// MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001')
+// MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001')