Change printfln to printfn. Make LLVM 15 tests default.

This commit is contained in:
Christoffer Lerno
2023-01-11 17:27:54 +01:00
committed by Christoffer Lerno
parent 3298ff2e15
commit dc16f65c8e
971 changed files with 30632 additions and 30623 deletions

View File

@@ -48,6 +48,25 @@ fn void main()
/* #expect: foo.ll
source_filename = "foo"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
@.str = private unnamed_addr constant [5 x i8] c"1-3\0A\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"7-277 %d\0A\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"4-5 %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"6 %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [20 x i8] c"Something else: %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"1-3\0A\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"4-6 %d\0A\00", align 1
@.str.7 = private unnamed_addr constant [20 x i8] c"Something else: %d\0A\00", align 1
@.str.8 = private unnamed_addr constant [11 x i8] c"Was true!\0A\00", align 1
@.str.9 = private unnamed_addr constant [12 x i8] c"Was false!\0A\00", align 1
; Function Attrs: nounwind
declare void @printf(ptr, ...) #0
; Function Attrs: nounwind
define void @foo_main() #0 {
entry:
%i = alloca i32, align 4
@@ -56,28 +75,28 @@ entry:
%switch15 = alloca i32, align 4
%x = alloca i8, align 1
%switch23 = alloca i8, align 1
store i32 0, i32* %i, align 4
store i32 0, ptr %i, align 4
br label %loop.cond
loop.cond: ; preds = %switch.exit, %entry
%0 = load i32, i32* %i, align 4
%0 = load i32, ptr %i, align 4
%lt = icmp slt i32 %0, 12
br i1 %lt, label %loop.body, label %loop.exit
loop.body: ; preds = %loop.cond
%1 = load i32, i32* %i, align 4
store i32 %1, i32* %switch, align 4
%1 = load i32, ptr %i, align 4
store i32 %1, ptr %switch, align 4
br label %switch.entry
switch.entry: ; preds = %loop.body
%2 = load i32, i32* %switch, align 4
%2 = load i32, ptr %switch, align 4
%le = icmp sle i32 1, %2
%ge = icmp sge i32 3, %2
%3 = and i1 %le, %ge
br i1 %3, label %switch.case, label %next_if
switch.case: ; preds = %switch.entry
call void (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0))
call void (ptr, ...) @printf(ptr @.str)
br label %switch.exit
next_if: ; preds = %switch.entry
@@ -87,8 +106,8 @@ next_if: ; preds = %switch.entry
br i1 %4, label %switch.case3, label %next_if4
switch.case3: ; preds = %next_if
%5 = load i32, i32* %i, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i32 %5)
%5 = load i32, ptr %i, align 4
call void (ptr, ...) @printf(ptr @.str.1, i32 %5)
br label %switch.exit
next_if4: ; preds = %next_if
@@ -98,8 +117,8 @@ next_if4: ; preds = %next_if
br i1 %6, label %switch.case7, label %next_if8
switch.case7: ; preds = %switch.default, %next_if4
%7 = load i32, i32* %i, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i32 %7)
%7 = load i32, ptr %i, align 4
call void (ptr, ...) @printf(ptr @.str.2, i32 %7)
br label %switch.exit
next_if8: ; preds = %next_if4
@@ -107,40 +126,40 @@ next_if8: ; preds = %next_if4
br i1 %eq, label %switch.case9, label %next_if10
switch.case9: ; preds = %next_if8
%8 = load i32, i32* %i, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i32 %8)
%8 = load i32, ptr %i, align 4
call void (ptr, ...) @printf(ptr @.str.3, i32 %8)
br label %switch.exit
next_if10: ; preds = %next_if8
br label %switch.default
switch.default: ; preds = %next_if10
%9 = load i32, i32* %i, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i32 0, i32 0), i32 %9)
%9 = load i32, ptr %i, align 4
call void (ptr, ...) @printf(ptr @.str.4, i32 %9)
br label %switch.case7
switch.exit: ; preds = %switch.case9, %switch.case7, %switch.case3, %switch.case
%10 = load i32, i32* %i, align 4
%10 = load i32, ptr %i, align 4
%add = add i32 %10, 1
store i32 %add, i32* %i, align 4
store i32 %add, ptr %i, align 4
br label %loop.cond
loop.exit: ; preds = %loop.cond
store i32 0, i32* %i11, align 4
store i32 0, ptr %i11, align 4
br label %loop.cond12
loop.cond12: ; preds = %switch.exit20, %loop.exit
%11 = load i32, i32* %i11, align 4
%11 = load i32, ptr %i11, align 4
%lt13 = icmp slt i32 %11, 12
br i1 %lt13, label %loop.body14, label %loop.exit22
loop.body14: ; preds = %loop.cond12
%12 = load i32, i32* %i11, align 4
store i32 %12, i32* %switch15, align 4
%12 = load i32, ptr %i11, align 4
store i32 %12, ptr %switch15, align 4
br label %switch.entry16
switch.entry16: ; preds = %loop.body14
%13 = load i32, i32* %switch15, align 4
%13 = load i32, ptr %switch15, align 4
switch i32 %13, label %switch.default19 [
i32 1, label %switch.case17
i32 2, label %switch.case17
@@ -151,39 +170,39 @@ switch.entry16: ; preds = %loop.body14
]
switch.case17: ; preds = %switch.entry16, %switch.entry16, %switch.entry16
call void (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0))
call void (ptr, ...) @printf(ptr @.str.5)
br label %switch.exit20
switch.case18: ; preds = %switch.default19, %switch.entry16, %switch.entry16, %switch.entry16
%14 = load i32, i32* %i11, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i32 %14)
%14 = load i32, ptr %i11, align 4
call void (ptr, ...) @printf(ptr @.str.6, i32 %14)
br label %switch.exit20
switch.default19: ; preds = %switch.entry16
%15 = load i32, i32* %i11, align 4
call void (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i32 0, i32 0), i32 %15)
%15 = load i32, ptr %i11, align 4
call void (ptr, ...) @printf(ptr @.str.7, i32 %15)
br label %switch.case18
switch.exit20: ; preds = %switch.case18, %switch.case17
%16 = load i32, i32* %i11, align 4
%16 = load i32, ptr %i11, align 4
%add21 = add i32 %16, 1
store i32 %add21, i32* %i11, align 4
store i32 %add21, ptr %i11, align 4
br label %loop.cond12
loop.exit22: ; preds = %loop.cond12
store i8 0, i8* %x, align 1
%17 = load i8, i8* %x, align 1
store i8 %17, i8* %switch23, align 1
store i8 0, ptr %x, align 1
%17 = load i8, ptr %x, align 1
store i8 %17, ptr %switch23, align 1
br label %switch.entry24
switch.entry24: ; preds = %loop.exit22
%18 = load i8, i8* %switch23, align 1
%18 = load i8, ptr %switch23, align 1
%19 = trunc i8 %18 to i1
%eq25 = icmp eq i1 true, %19
br i1 %eq25, label %switch.case26, label %next_if27
switch.case26: ; preds = %switch.entry24
call void (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i32 0, i32 0))
call void (ptr, ...) @printf(ptr @.str.8)
br label %switch.exit31
next_if27: ; preds = %switch.entry24
@@ -191,7 +210,7 @@ next_if27: ; preds = %switch.entry24
br i1 %eq28, label %switch.case29, label %next_if30
switch.case29: ; preds = %next_if27
call void (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i32 0, i32 0))
call void (ptr, ...) @printf(ptr @.str.9)
br label %switch.exit31
next_if30: ; preds = %next_if27
@@ -200,3 +219,12 @@ next_if30: ; preds = %next_if27
switch.exit31: ; preds = %next_if30, %switch.case29, %switch.case26
ret void
}
; Function Attrs: nounwind
define i32 @main(i32 %0, ptr %1) #0 {
entry:
call void @foo_main()
ret i32 0
}
attributes #0 = { nounwind }