summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-03-28 19:14:08 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-03-28 19:14:08 +0000
commita53735bcf1fae56a81f1a83f6988ff4eb6577c5c (patch)
treeb62f6c526f7dc6501b01cbe35fd5ea4a02349239 /test
parentbe560a3fb7f5d1901583d84e22b10aadb502b4af (diff)
downloadllvm-a53735bcf1fae56a81f1a83f6988ff4eb6577c5c.tar.gz
llvm-a53735bcf1fae56a81f1a83f6988ff4eb6577c5c.tar.bz2
llvm-a53735bcf1fae56a81f1a83f6988ff4eb6577c5c.tar.xz
Map ELf flags back to more specific section kinds.
With that, convert another llc -filetype=obj test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/Mips/elf-relsym.ll39
-rw-r--r--test/MC/Mips/elf-relsym.s87
2 files changed, 87 insertions, 39 deletions
diff --git a/test/MC/Mips/elf-relsym.ll b/test/MC/Mips/elf-relsym.ll
deleted file mode 100644
index 6da926273a..0000000000
--- a/test/MC/Mips/elf-relsym.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux %s -o - | llvm-readobj -t | FileCheck %s
-
-; Check that the appropriate symbols were created.
-
-; CHECK: Symbols [
-; CHECK: Symbol {
-; CHECK: Name: $.str
-; CHECK: }
-; CHECK: Symbol {
-; CHECK: Name: $.str1
-; CHECK: }
-; CHECK: Symbol {
-; CHECK: Name: $CPI0_0
-; CHECK: }
-; CHECK: Symbol {
-; CHECK: Name: $CPI0_1
-; CHECK: }
-; CHECK: ]
-
-@.str = private unnamed_addr constant [6 x i8] c"abcde\00", align 1
-@gc1 = external global i8*
-@.str1 = private unnamed_addr constant [5 x i8] c"fghi\00", align 1
-@gc2 = external global i8*
-@gd1 = external global double
-@gd2 = external global double
-
-define void @foo1() nounwind {
-entry:
- store i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i8** @gc1, align 4
- store i8* getelementptr inbounds ([5 x i8]* @.str1, i32 0, i32 0), i8** @gc2, align 4
- %0 = load double* @gd1, align 8
- %add = fadd double %0, 2.500000e+00
- store double %add, double* @gd1, align 8
- %1 = load double* @gd2, align 8
- %add1 = fadd double %1, 4.500000e+00
- store double %add1, double* @gd2, align 8
- ret void
-}
-
diff --git a/test/MC/Mips/elf-relsym.s b/test/MC/Mips/elf-relsym.s
new file mode 100644
index 0000000000..d19065e0cd
--- /dev/null
+++ b/test/MC/Mips/elf-relsym.s
@@ -0,0 +1,87 @@
+// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o - | llvm-readobj -t | FileCheck %s
+
+// Check that the appropriate symbols were created.
+
+// CHECK: Symbols [
+// CHECK: Symbol {
+// CHECK: Name: $.str
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: $.str1
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: $CPI0_0
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: $CPI0_1
+// CHECK: }
+// CHECK: ]
+
+ .text
+ .abicalls
+ .section .mdebug.abi32,"",@progbits
+ .file "/home/espindola/llvm/llvm/test/MC/Mips/elf-relsym.ll"
+ .section .rodata.cst8,"aM",@progbits,8
+ .align 3
+$CPI0_0:
+ .8byte 4612811918334230528 # double 2.5
+$CPI0_1:
+ .8byte 4616752568008179712 # double 4.5
+ .text
+ .globl foo1
+ .align 2
+ .type foo1,@function
+ .set nomips16
+ .ent foo1
+foo1: # @foo1
+ .frame $sp,0,$ra
+ .mask 0x00000000,0
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ .set noat
+# BB#0: # %entry
+ lui $2, %hi(_gp_disp)
+ addiu $2, $2, %lo(_gp_disp)
+ addu $1, $2, $25
+ lw $2, %got($.str)($1)
+ addiu $2, $2, %lo($.str)
+ lw $3, %got(gc1)($1)
+ sw $2, 0($3)
+ lw $2, %got($.str1)($1)
+ addiu $2, $2, %lo($.str1)
+ lw $3, %got(gc2)($1)
+ sw $2, 0($3)
+ lw $2, %got($CPI0_0)($1)
+ ldc1 $f0, %lo($CPI0_0)($2)
+ lw $2, %got(gd1)($1)
+ ldc1 $f2, 0($2)
+ lw $3, %got($CPI0_1)($1)
+ ldc1 $f4, %lo($CPI0_1)($3)
+ lw $1, %got(gd2)($1)
+ add.d $f0, $f2, $f0
+ sdc1 $f0, 0($2)
+ ldc1 $f0, 0($1)
+ add.d $f0, $f0, $f4
+ jr $ra
+ sdc1 $f0, 0($1)
+ .set at
+ .set macro
+ .set reorder
+ .end foo1
+$tmp0:
+ .size foo1, ($tmp0)-foo1
+
+ .type $.str,@object # @.str
+ .section .rodata.str1.1,"aMS",@progbits,1
+$.str:
+ .asciz "abcde"
+ .size $.str, 6
+
+ .type $.str1,@object # @.str1
+$.str1:
+ .asciz "fghi"
+ .size $.str1, 5
+
+
+ .text