mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
5a70dd1d82
Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
61 lines
1.9 KiB
LLVM
61 lines
1.9 KiB
LLVM
; DISABLE: llc -filetype=obj -mtriple mips-unknown-linux %s -o - | llvm-readobj -h -s -sd | FileCheck %s
|
|
; RUN: false
|
|
; XFAIL: *
|
|
|
|
; Check that this is big endian.
|
|
; CHECK: ElfHeader {
|
|
; CHECK: Ident {
|
|
; CHECK: DataEncoding: BigEndian
|
|
; CHECK: }
|
|
; CHECK: }
|
|
|
|
; Make sure that a section table (text) entry is correct.
|
|
; 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
|
|
|
|
; See that at least first 3 instructions are correct: GP prologue
|
|
; CHECK-NEXT: SectionData (
|
|
; CHECK-NEXT: 0000: 3C1C0000 279C0000 0399E021 {{[0-9,A-F, ]*}}
|
|
; CHECK: )
|
|
; CHECK: }
|
|
|
|
; 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:
|
|
%0 = load i32, i32* @x, align 4
|
|
%tobool = icmp eq i32 %0, 0
|
|
br i1 %tobool, label %if.end, label %foo
|
|
|
|
if.end: ; preds = %entry
|
|
%puts = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i32 0, i32 0))
|
|
br label %foo
|
|
|
|
foo: ; preds = %entry, %if.end
|
|
%puts2 = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str2, i32 0, i32 0))
|
|
ret i32 0
|
|
}
|
|
|
|
declare i32 @puts(i8* nocapture) nounwind
|
|
|