aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/Mips
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/Mips')
-rw-r--r--test/MC/Mips/elf-bigendian.ll20
-rw-r--r--test/MC/Mips/elf_basic.s35
-rw-r--r--test/MC/Mips/lit.local.cfg9
-rw-r--r--test/MC/Mips/sym-offset.ll22
4 files changed, 63 insertions, 23 deletions
diff --git a/test/MC/Mips/elf-bigendian.ll b/test/MC/Mips/elf-bigendian.ll
index 875ba3b..71c69bb 100644
--- a/test/MC/Mips/elf-bigendian.ll
+++ b/test/MC/Mips/elf-bigendian.ll
@@ -5,18 +5,18 @@
; Make sure that a section table (text) entry is correct.
; CHECK: (('sh_name', 0x{{[0]*}}5) # '.text'
-; CHECKNEXT: ('sh_type', 0x{{[0]*}}1)
-; CHECKNEXT: ('sh_flags', 0x{{[0]*}}6)
-; CHECKNEXT: ('sh_addr', 0x{{{[0-9,a-f]+}})
-; CHECKNEXT: ('sh_offset', 0x{{{[0-9,a-f]+}})
-; CHECKNEXT: ('sh_size', 0x{{{[0-9,a-f]+}})
-; CHECKNEXT: ('sh_link', 0x{{[0]+}})
-; CHECKNEXT: ('sh_info', 0x{{[0]+}})
-; CHECKNEXT: ('sh_addralign', 0x{{[0]*}}4)
-; CHECKNEXT: ('sh_entsize', 0x{{[0]+}})
+; CHECK-NEXT: ('sh_type', 0x{{[0]*}}1)
+; CHECK-NEXT: ('sh_flags', 0x{{[0]*}}6)
+; CHECK-NEXT: ('sh_addr', 0x{{[0-9,a-f]+}})
+; CHECK-NEXT: ('sh_offset', 0x{{[0-9,a-f]+}})
+; CHECK-NEXT: ('sh_size', 0x{{[0-9,a-f]+}})
+; CHECK-NEXT: ('sh_link', 0x{{[0]+}})
+; CHECK-NEXT: ('sh_info', 0x{{[0]+}})
+; CHECK-NEXT: ('sh_addralign', 0x{{[0]*}}4)
+; CHECK-NEXT: ('sh_entsize', 0x{{[0]+}})
; See that at least first 3 instructions are correct: GP prologue
-; CHECKNEXT: ('_section_data', '3c1c0000 279c0000 0399e021 {{[0-9,a-f]*}}')
+; CHECK-NEXT: ('_section_data', '3c1c0000 279c0000 0399e021 {{[0-9,a-f, ]*}}')
; ModuleID = '../br1.c'
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32"
diff --git a/test/MC/Mips/elf_basic.s b/test/MC/Mips/elf_basic.s
index f7ed348..7a79fa0 100644
--- a/test/MC/Mips/elf_basic.s
+++ b/test/MC/Mips/elf_basic.s
@@ -1,7 +1,32 @@
-// RUN: llvm-mc -filetype=obj -triple mips-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-BE %s
-// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-LE %s
+// 32 bit big endian
+// RUN: llvm-mc -filetype=obj -triple mips-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-BE32 %s
+// 32 bit little endian
+// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-LE32 %s
+// 64 bit big endian
+// RUN: llvm-mc -filetype=obj -arch=mips64 -triple mips64-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-BE64 %s
+// 64 bit little endian
+// RUN: llvm-mc -filetype=obj -arch=mips64el -triple mips64el-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=CHECK-LE64 %s
-// Check that we produce the correct endian.
+// Check that we produce 32 bit with each endian.
-// CHECK-BE: ('e_indent[EI_DATA]', 0x02)
-// CHECK-LE: ('e_indent[EI_DATA]', 0x01)
+// This is 32 bit.
+// CHECK-BE32: ('e_indent[EI_CLASS]', 0x01)
+// This is big endian.
+// CHECK-BE32: ('e_indent[EI_DATA]', 0x02)
+
+// This is 32 bit.
+// CHECK-LE32: ('e_indent[EI_CLASS]', 0x01)
+// This is little endian.
+// CHECK-LE32: ('e_indent[EI_DATA]', 0x01)
+
+// Check that we produce 64 bit with each endian.
+
+// This is 64 bit.
+// CHECK-BE64: ('e_indent[EI_CLASS]', 0x02)
+// This is big endian.
+// CHECK-BE64: ('e_indent[EI_DATA]', 0x02)
+
+// This is 64 bit.
+// CHECK-LE64: ('e_indent[EI_CLASS]', 0x02)
+// This is little endian.
+// CHECK-LE64: ('e_indent[EI_DATA]', 0x01)
diff --git a/test/MC/Mips/lit.local.cfg b/test/MC/Mips/lit.local.cfg
index ecc61ea..d2e3b28 100644
--- a/test/MC/Mips/lit.local.cfg
+++ b/test/MC/Mips/lit.local.cfg
@@ -1,13 +1,6 @@
config.suffixes = ['.ll', '.c', '.cpp', '.s']
-def getRoot(config):
- if not config.parent:
- return config
- return getRoot(config.parent)
-
-root = getRoot(config)
-
-targets = set(root.targets_to_build.split())
+targets = set(config.root.targets_to_build.split())
if not 'Mips' in targets:
config.unsupported = True
diff --git a/test/MC/Mips/sym-offset.ll b/test/MC/Mips/sym-offset.ll
new file mode 100644
index 0000000..5939935
--- /dev/null
+++ b/test/MC/Mips/sym-offset.ll
@@ -0,0 +1,22 @@
+; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux %s -o - | elf-dump --dump-section-data | FileCheck %s
+
+; FIXME: use assembler instead of llc when it becomes available.
+
+@string1 = internal global [11 x i8] c"aaaaaaaaaa\00", align 1
+@string2 = internal global [10 x i8] c"aaaa\00bbbb\00", align 1
+
+define i32 @foo1(i32 %n) nounwind readonly {
+entry:
+; check that the immediate fields of lwl and lwr are three apart.
+; 8841000e lwl at,14(v0)
+; 9841000b lwr at,11(v0)
+
+; CHECK: ('_section_data', '00001c3c 00009c27 21e09903 0000828f 0e004188 0b004198
+
+ %call = tail call i32 @memcmp(i8* getelementptr inbounds ([11 x i8]* @string1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8]* @string2, i32 0, i32 0), i32 4) nounwind readonly
+ %cmp = icmp eq i32 %call, 0
+ %conv = zext i1 %cmp to i32
+ ret i32 %conv
+}
+
+declare i32 @memcmp(i8* nocapture, i8* nocapture, i32) nounwind readonly