74a20055c3
Vier Snapshots in crates/ail/tests/snapshots/ (sum, max3, hello, list) sichern den erzeugten LLVM-IR. Test-Helper normalisiert target triple und trailing whitespace, sonst byte-für-byte-Vergleich. Update via UPDATE_SNAPSHOTS=1 cargo test ir_snapshot_. Mismatch erzeugt eine .actual-Datei mit dem aktuellen Output für Diff-Inspektion.
22 lines
396 B
LLVM
22 lines
396 B
LLVM
; AILang generated module: hello
|
|
source_filename = "hello.ail"
|
|
target triple = "<NORMALIZED>"
|
|
|
|
@.str_str_0 = private unnamed_addr constant [15 x i8] c"Hallo, AILang.\00", align 1
|
|
|
|
declare i32 @printf(ptr, ...)
|
|
declare i32 @puts(ptr)
|
|
declare ptr @malloc(i64)
|
|
|
|
define i8 @ail_main() {
|
|
entry:
|
|
call i32 @puts(ptr @.str_str_0)
|
|
ret i8 0
|
|
}
|
|
|
|
|
|
define i32 @main() {
|
|
call i8 @ail_main()
|
|
ret i32 0
|
|
}
|