2019-05-01 07:27:20 +02:00
|
|
|
; DISABLE: llc -filetype=obj -mtriple mips-unknown-linux %s -o - | llvm-readobj -h -S --sd | FileCheck %s
|
2012-05-12 02:48:43 +02:00
|
|
|
; RUN: false
|
|
|
|
; XFAIL: *
|
2012-03-21 01:52:01 +01:00
|
|
|
|
|
|
|
; Check that this is big endian.
|
2013-04-12 06:06:46 +02:00
|
|
|
; CHECK: ElfHeader {
|
|
|
|
; CHECK: Ident {
|
|
|
|
; CHECK: DataEncoding: BigEndian
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: }
|
2012-03-21 01:52:01 +01:00
|
|
|
|
|
|
|
; Make sure that a section table (text) entry is correct.
|
2013-04-12 06:06:46 +02:00
|
|
|
; CHECK: Sections [
|
|
|
|
; CHECK: Section {
|
|
|
|
; CHECK: Index:
|
|
|
|
; CHECK: Name: .text
|
|
|
|
; CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
; CHECK-NEXT: Flags [ (0x6)
|
|
|
|
; CHECK-NEXT: SHF_ALLOC
|
|
|
|
; CHECK-NEXT: SHF_EXECINSTR
|
|
|
|
; CHECK-NEXT: ]
|
|
|
|
; CHECK-NEXT: Address: 0x{{[0-9,A-F]+}}
|
|
|
|
; CHECK-NEXT: Offset: 0x{{[0-9,A-F]+}}
|
|
|
|
; CHECK-NEXT: Size: {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: Link: 0
|
|
|
|
; CHECK-NEXT: Info: 0
|
|
|
|
; CHECK-NEXT: AddressAlignment: 4
|
|
|
|
; CHECK-NEXT: EntrySize: 0
|
2012-03-21 01:52:01 +01:00
|
|
|
|
|
|
|
; See that at least first 3 instructions are correct: GP prologue
|
2013-04-12 06:06:46 +02:00
|
|
|
; CHECK-NEXT: SectionData (
|
|
|
|
; CHECK-NEXT: 0000: 3C1C0000 279C0000 0399E021 {{[0-9,A-F, ]*}}
|
|
|
|
; CHECK: )
|
|
|
|
; CHECK: }
|
2012-03-21 01:52:01 +01:00
|
|
|
|
|
|
|
; 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"
|
|
|
|
target triple = "mips-unknown-linux"
|
|
|
|
|
|
|
|
@x = global i32 1, align 4
|
|
|
|
@str = private unnamed_addr constant [4 x i8] c"goo\00"
|
|
|
|
@str2 = private unnamed_addr constant [4 x i8] c"foo\00"
|
|
|
|
|
|
|
|
define i32 @main() nounwind {
|
|
|
|
entry:
|
2015-02-27 22:17:42 +01:00
|
|
|
%0 = load i32, i32* @x, align 4
|
2012-03-21 01:52:01 +01:00
|
|
|
%tobool = icmp eq i32 %0, 0
|
|
|
|
br i1 %tobool, label %if.end, label %foo
|
|
|
|
|
|
|
|
if.end: ; preds = %entry
|
2015-03-13 19:20:45 +01:00
|
|
|
%puts = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i32 0, i32 0))
|
2012-03-21 01:52:01 +01:00
|
|
|
br label %foo
|
|
|
|
|
|
|
|
foo: ; preds = %entry, %if.end
|
2015-03-13 19:20:45 +01:00
|
|
|
%puts2 = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str2, i32 0, i32 0))
|
2012-03-21 01:52:01 +01:00
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @puts(i8* nocapture) nounwind
|
|
|
|
|