[llvm] r205042 - Convert one last llc -filetype=obj test.

Rafael Espindola rafael.espindola at gmail.com
Fri Mar 28 12:58:24 PDT 2014


Author: rafael
Date: Fri Mar 28 14:58:24 2014
New Revision: 205042

URL: http://llvm.org/viewvc/llvm-project?rev=205042&view=rev
Log:
Convert one last llc -filetype=obj test.

Unfortunately this one fails deep inside the mips backend, so xfail it.

Added:
    llvm/trunk/test/MC/Mips/xgot.s
Removed:
    llvm/trunk/test/MC/Mips/xgot.ll

Removed: llvm/trunk/test/MC/Mips/xgot.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/xgot.ll?rev=205041&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/xgot.ll (original)
+++ llvm/trunk/test/MC/Mips/xgot.ll (removed)
@@ -1,29 +0,0 @@
-; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mxgot %s -o - | llvm-readobj -r | FileCheck %s
-
- at .str = private unnamed_addr constant [16 x i8] c"ext_1=%d, i=%d\0A\00", align 1
- at ext_1 = external global i32
-
-define void @fill() nounwind {
-entry:
-
-; Check that the appropriate relocations were created. 
-; For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.
-
-; CHECK: Relocations [
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_HI16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_LO16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_HI16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_LO16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_HI16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT
-; CHECK:     0x{{[0-9,A-F]+}} R_MIPS_LO16
-; CHECK: ]
-
-  %0 = load i32* @ext_1, align 4
-  %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([16 x i8]* @.str, i32 0, i32 0), i32 %0) nounwind
-  ret void
-}
-
-declare i32 @printf(i8* nocapture, ...) nounwind
-

Added: llvm/trunk/test/MC/Mips/xgot.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/xgot.s?rev=205042&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/xgot.s (added)
+++ llvm/trunk/test/MC/Mips/xgot.s Fri Mar 28 14:58:24 2014
@@ -0,0 +1,70 @@
+// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux  %s -o - | llvm-readobj -r | FileCheck %s
+
+// Expected failure since the mips backend can't handle this yet.
+// XFAIL: *
+
+// Check that the appropriate relocations were created.
+// For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.
+
+// CHECK: Relocations [
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_HI16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_LO16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_HI16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_LO16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_HI16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT
+// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_LO16
+// CHECK: ]
+
+	.text
+	.abicalls
+	.section	.mdebug.abi32,"", at progbits
+	.file	"/home/espindola/llvm/llvm/test/MC/Mips/xgot.ll"
+	.text
+	.globl	fill
+	.align	2
+	.type	fill, at function
+	.set	nomips16
+	.ent	fill
+fill:                                   # @fill
+	.frame	$sp,24,$ra
+	.mask 	0x80000000,-4
+	.fmask	0x00000000,0
+	.set	noreorder
+	.set	nomacro
+	.set	noat
+# BB#0:                                 # %entry
+	lui	$2, %hi(_gp_disp)
+	addiu	$2, $2, %lo(_gp_disp)
+	addiu	$sp, $sp, -24
+	sw	$ra, 20($sp)            # 4-byte Folded Spill
+	addu	$gp, $2, $25
+	lui	$1, %got_hi(ext_1)
+	addu	$1, $1, $gp
+	lw	$1, %got_lo(ext_1)($1)
+	lw	$5, 0($1)
+	lui	$1, %call_hi(printf)
+	addu	$1, $1, $gp
+	lw	$2, %got($.str)($gp)
+	lw	$25, %call_lo(printf)($1)
+	jalr	$25
+	addiu	$4, $2, %lo($.str)
+	lw	$ra, 20($sp)            # 4-byte Folded Reload
+	jr	$ra
+	addiu	$sp, $sp, 24
+	.set	at
+	.set	macro
+	.set	reorder
+	.end	fill
+$tmp0:
+	.size	fill, ($tmp0)-fill
+
+	.type	$.str, at object           # @.str
+	.section	.rodata.str1.1,"aMS", at progbits,1
+$.str:
+	.asciz	"ext_1=%d, i=%d\n"
+	.size	$.str, 16
+
+
+	.text





More information about the llvm-commits mailing list