[llvm] r205039 - Convert llc -filetype=obj test.
Rafael Espindola
rafael.espindola at gmail.com
Fri Mar 28 12:38:20 PDT 2014
Author: rafael
Date: Fri Mar 28 14:38:20 2014
New Revision: 205039
URL: http://llvm.org/viewvc/llvm-project?rev=205039&view=rev
Log:
Convert llc -filetype=obj test.
Added:
llvm/trunk/test/MC/Mips/mips_gprel16.s
Removed:
llvm/trunk/test/MC/Mips/mips_gprel16.ll
Removed: llvm/trunk/test/MC/Mips/mips_gprel16.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_gprel16.ll?rev=205038&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_gprel16.ll (original)
+++ llvm/trunk/test/MC/Mips/mips_gprel16.ll (removed)
@@ -1,33 +0,0 @@
-; This addresses bug 14456. We were not writing
-; out the addend to the gprel16 relocation. The
-; addend is stored in the instruction immediate
-; field.
-;llc gprel16.ll -o gprel16.o -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static
-
-; RUN: llc -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static %s -o - \
-; RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
-; RUN: | FileCheck %s
-
-target triple = "mipsel-sde--elf-gcc"
-
- at var1 = internal global i32 0, align 4
- at var2 = internal global i32 0, align 4
-
-define i32 @testvar1() nounwind {
-entry:
-; CHECK: lw ${{[0-9]+}}, 0($gp)
- %0 = load i32* @var1, align 4
- %tobool = icmp ne i32 %0, 0
- %cond = select i1 %tobool, i32 1, i32 0
- ret i32 %cond
-}
-
-define i32 @testvar2() nounwind {
-entry:
-; CHECK: lw ${{[0-9]+}}, 4($gp)
- %0 = load i32* @var2, align 4
- %tobool = icmp ne i32 %0, 0
- %cond = select i1 %tobool, i32 1, i32 0
- ret i32 %cond
-}
-
Added: llvm/trunk/test/MC/Mips/mips_gprel16.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_gprel16.s?rev=205039&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_gprel16.s (added)
+++ llvm/trunk/test/MC/Mips/mips_gprel16.s Fri Mar 28 14:38:20 2014
@@ -0,0 +1,70 @@
+// This addresses bug 14456. We were not writing
+// out the addend to the gprel16 relocation. The
+// addend is stored in the instruction immediate
+// field.
+
+// RUN: llvm-mc -mcpu=mips32r2 -triple=mipsel-pc-linux -filetype=obj -relocation-model=static %s -o - \
+// RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
+// RUN: | FileCheck %s
+
+ .text
+ .abicalls
+ .option pic0
+ .section .mdebug.abi32,"", at progbits
+ .file "/home/espindola/llvm/llvm/test/MC/Mips/mips_gprel16.ll"
+ .text
+ .globl testvar1
+ .align 2
+ .type testvar1, at function
+ .set nomips16
+ .ent testvar1
+testvar1: # @testvar1
+ .frame $sp,0,$ra
+ .mask 0x00000000,0
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ .set noat
+# BB#0: # %entry
+// CHECK: lw ${{[0-9]+}}, 0($gp)
+ lw $1, %gp_rel(var1)($gp)
+ jr $ra
+ sltu $2, $zero, $1
+ .set at
+ .set macro
+ .set reorder
+ .end testvar1
+$tmp0:
+ .size testvar1, ($tmp0)-testvar1
+
+ .globl testvar2
+ .align 2
+ .type testvar2, at function
+ .set nomips16
+ .ent testvar2
+testvar2: # @testvar2
+ .frame $sp,0,$ra
+ .mask 0x00000000,0
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ .set noat
+# BB#0: # %entry
+// CHECK: lw ${{[0-9]+}}, 4($gp)
+ lw $1, %gp_rel(var2)($gp)
+ jr $ra
+ sltu $2, $zero, $1
+ .set at
+ .set macro
+ .set reorder
+ .end testvar2
+$tmp1:
+ .size testvar2, ($tmp1)-testvar2
+
+ .type var1, at object # @var1
+ .local var1
+ .comm var1,4,4
+ .type var2, at object # @var2
+ .local var2
+ .comm var2,4,4
+
More information about the llvm-commits
mailing list