internal/cabi: support target esp32c3
This commit is contained in:
@@ -333,7 +333,7 @@ func Do(args []string, conf *Config) ([]Package, error) {
|
|||||||
needPyInit: make(map[*packages.Package]bool),
|
needPyInit: make(map[*packages.Package]bool),
|
||||||
buildConf: conf,
|
buildConf: conf,
|
||||||
crossCompile: export,
|
crossCompile: export,
|
||||||
cTransformer: cabi.NewTransformer(prog, conf.Target, conf.AbiMode, cabiOptimize),
|
cTransformer: cabi.NewTransformer(prog, conf.Target, export.TargetABI, conf.AbiMode, cabiOptimize),
|
||||||
}
|
}
|
||||||
pkgs, err := buildAllPkgs(ctx, initial, verbose)
|
pkgs, err := buildAllPkgs(ctx, initial, verbose)
|
||||||
check(err)
|
check(err)
|
||||||
|
|||||||
246
internal/cabi/_testdata/arch/esp32c3/array_float32.ll
Normal file
246
internal/cabi/_testdata/arch/esp32c3/array_float32.ll
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
; ModuleID = '../../wrap/array_float32.c'
|
||||||
|
source_filename = "../../wrap/array_float32.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x float] }
|
||||||
|
%struct.array2 = type { [2 x float] }
|
||||||
|
%struct.array3 = type { [3 x float] }
|
||||||
|
%struct.array4 = type { [4 x float] }
|
||||||
|
%struct.array5 = type { [5 x float] }
|
||||||
|
%struct.array6 = type { [6 x float] }
|
||||||
|
%struct.array7 = type { [7 x float] }
|
||||||
|
%struct.array8 = type { [8 x float] }
|
||||||
|
%struct.array9 = type { [9 x float] }
|
||||||
|
%struct.array10 = type { [10 x float] }
|
||||||
|
%struct.array11 = type { [11 x float] }
|
||||||
|
%struct.array12 = type { [12 x float] }
|
||||||
|
%struct.array13 = type { [13 x float] }
|
||||||
|
%struct.array14 = type { [14 x float] }
|
||||||
|
%struct.array15 = type { [15 x float] }
|
||||||
|
%struct.array16 = type { [16 x float] }
|
||||||
|
%struct.array17 = type { [17 x float] }
|
||||||
|
%struct.array18 = type { [18 x float] }
|
||||||
|
%struct.array19 = type { [19 x float] }
|
||||||
|
%struct.array20 = type { [20 x float] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 4
|
||||||
|
%3 = alloca %struct.array1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 4
|
||||||
|
%3 = alloca %struct.array2, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/array_float64.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/array_float64.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/array_float64.c'
|
||||||
|
source_filename = "../../wrap/array_float64.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x double] }
|
||||||
|
%struct.array2 = type { [2 x double] }
|
||||||
|
%struct.array3 = type { [3 x double] }
|
||||||
|
%struct.array4 = type { [4 x double] }
|
||||||
|
%struct.array5 = type { [5 x double] }
|
||||||
|
%struct.array6 = type { [6 x double] }
|
||||||
|
%struct.array7 = type { [7 x double] }
|
||||||
|
%struct.array8 = type { [8 x double] }
|
||||||
|
%struct.array9 = type { [9 x double] }
|
||||||
|
%struct.array10 = type { [10 x double] }
|
||||||
|
%struct.array11 = type { [11 x double] }
|
||||||
|
%struct.array12 = type { [12 x double] }
|
||||||
|
%struct.array13 = type { [13 x double] }
|
||||||
|
%struct.array14 = type { [14 x double] }
|
||||||
|
%struct.array15 = type { [15 x double] }
|
||||||
|
%struct.array16 = type { [16 x double] }
|
||||||
|
%struct.array17 = type { [17 x double] }
|
||||||
|
%struct.array18 = type { [18 x double] }
|
||||||
|
%struct.array19 = type { [19 x double] }
|
||||||
|
%struct.array20 = type { [20 x double] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i64 @demo1(i64 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 8
|
||||||
|
%3 = alloca %struct.array1, align 8
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i64 %0, ptr %4, align 8
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %2, ptr align 8 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i64, ptr %5, align 8
|
||||||
|
ret i64 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo2(ptr dead_on_unwind noalias writable sret(%struct.array2) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 88, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 96, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 104, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 112, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 120, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 128, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 136, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 144, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 152, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 160, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
257
internal/cabi/_testdata/arch/esp32c3/array_int16.ll
Normal file
257
internal/cabi/_testdata/arch/esp32c3/array_int16.ll
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
; ModuleID = '../../wrap/array_int16.c'
|
||||||
|
source_filename = "../../wrap/array_int16.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x i16] }
|
||||||
|
%struct.array2 = type { [2 x i16] }
|
||||||
|
%struct.array3 = type { [3 x i16] }
|
||||||
|
%struct.array4 = type { [4 x i16] }
|
||||||
|
%struct.array5 = type { [5 x i16] }
|
||||||
|
%struct.array6 = type { [6 x i16] }
|
||||||
|
%struct.array7 = type { [7 x i16] }
|
||||||
|
%struct.array8 = type { [8 x i16] }
|
||||||
|
%struct.array9 = type { [9 x i16] }
|
||||||
|
%struct.array10 = type { [10 x i16] }
|
||||||
|
%struct.array11 = type { [11 x i16] }
|
||||||
|
%struct.array12 = type { [12 x i16] }
|
||||||
|
%struct.array13 = type { [13 x i16] }
|
||||||
|
%struct.array14 = type { [14 x i16] }
|
||||||
|
%struct.array15 = type { [15 x i16] }
|
||||||
|
%struct.array16 = type { [16 x i16] }
|
||||||
|
%struct.array17 = type { [17 x i16] }
|
||||||
|
%struct.array18 = type { [18 x i16] }
|
||||||
|
%struct.array19 = type { [19 x i16] }
|
||||||
|
%struct.array20 = type { [20 x i16] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 2
|
||||||
|
%3 = alloca %struct.array1, align 2
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
%6 = trunc i32 %0 to i16
|
||||||
|
store i16 %6, ptr %5, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 2, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 2 %7, i32 2, i1 false)
|
||||||
|
%8 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo2(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 2
|
||||||
|
%3 = alloca %struct.array2, align 2
|
||||||
|
%4 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 2
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo3([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array3, align 2
|
||||||
|
%3 = alloca %struct.array3, align 2
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
%6 = getelementptr inbounds %struct.array3, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %6, ptr align 4 %4, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 6, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array3, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 2 %7, i32 6, i1 false)
|
||||||
|
%8 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo4([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array4, align 2
|
||||||
|
%3 = alloca %struct.array4, align 2
|
||||||
|
%4 = getelementptr inbounds %struct.array4, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array4, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 2
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 10, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 14, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 18, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 22, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 26, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 30, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 34, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 38, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
246
internal/cabi/_testdata/arch/esp32c3/array_int32.ll
Normal file
246
internal/cabi/_testdata/arch/esp32c3/array_int32.ll
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
; ModuleID = '../../wrap/array_int32.c'
|
||||||
|
source_filename = "../../wrap/array_int32.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x i32] }
|
||||||
|
%struct.array2 = type { [2 x i32] }
|
||||||
|
%struct.array3 = type { [3 x i32] }
|
||||||
|
%struct.array4 = type { [4 x i32] }
|
||||||
|
%struct.array5 = type { [5 x i32] }
|
||||||
|
%struct.array6 = type { [6 x i32] }
|
||||||
|
%struct.array7 = type { [7 x i32] }
|
||||||
|
%struct.array8 = type { [8 x i32] }
|
||||||
|
%struct.array9 = type { [9 x i32] }
|
||||||
|
%struct.array10 = type { [10 x i32] }
|
||||||
|
%struct.array11 = type { [11 x i32] }
|
||||||
|
%struct.array12 = type { [12 x i32] }
|
||||||
|
%struct.array13 = type { [13 x i32] }
|
||||||
|
%struct.array14 = type { [14 x i32] }
|
||||||
|
%struct.array15 = type { [15 x i32] }
|
||||||
|
%struct.array16 = type { [16 x i32] }
|
||||||
|
%struct.array17 = type { [17 x i32] }
|
||||||
|
%struct.array18 = type { [18 x i32] }
|
||||||
|
%struct.array19 = type { [19 x i32] }
|
||||||
|
%struct.array20 = type { [20 x i32] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 4
|
||||||
|
%3 = alloca %struct.array1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 4
|
||||||
|
%3 = alloca %struct.array2, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/array_int64.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/array_int64.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/array_int64.c'
|
||||||
|
source_filename = "../../wrap/array_int64.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x i64] }
|
||||||
|
%struct.array2 = type { [2 x i64] }
|
||||||
|
%struct.array3 = type { [3 x i64] }
|
||||||
|
%struct.array4 = type { [4 x i64] }
|
||||||
|
%struct.array5 = type { [5 x i64] }
|
||||||
|
%struct.array6 = type { [6 x i64] }
|
||||||
|
%struct.array7 = type { [7 x i64] }
|
||||||
|
%struct.array8 = type { [8 x i64] }
|
||||||
|
%struct.array9 = type { [9 x i64] }
|
||||||
|
%struct.array10 = type { [10 x i64] }
|
||||||
|
%struct.array11 = type { [11 x i64] }
|
||||||
|
%struct.array12 = type { [12 x i64] }
|
||||||
|
%struct.array13 = type { [13 x i64] }
|
||||||
|
%struct.array14 = type { [14 x i64] }
|
||||||
|
%struct.array15 = type { [15 x i64] }
|
||||||
|
%struct.array16 = type { [16 x i64] }
|
||||||
|
%struct.array17 = type { [17 x i64] }
|
||||||
|
%struct.array18 = type { [18 x i64] }
|
||||||
|
%struct.array19 = type { [19 x i64] }
|
||||||
|
%struct.array20 = type { [20 x i64] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i64 @demo1(i64 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 8
|
||||||
|
%3 = alloca %struct.array1, align 8
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i64 %0, ptr %4, align 8
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %2, ptr align 8 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i64, ptr %5, align 8
|
||||||
|
ret i64 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo2(ptr dead_on_unwind noalias writable sret(%struct.array2) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 88, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 96, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 104, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 112, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 120, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 128, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 136, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 144, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 152, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 160, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
279
internal/cabi/_testdata/arch/esp32c3/array_int8.ll
Normal file
279
internal/cabi/_testdata/arch/esp32c3/array_int8.ll
Normal file
@@ -0,0 +1,279 @@
|
|||||||
|
; ModuleID = '../../wrap/array_int8.c'
|
||||||
|
source_filename = "../../wrap/array_int8.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x i8] }
|
||||||
|
%struct.array2 = type { [2 x i8] }
|
||||||
|
%struct.array3 = type { [3 x i8] }
|
||||||
|
%struct.array4 = type { [4 x i8] }
|
||||||
|
%struct.array5 = type { [5 x i8] }
|
||||||
|
%struct.array6 = type { [6 x i8] }
|
||||||
|
%struct.array7 = type { [7 x i8] }
|
||||||
|
%struct.array8 = type { [8 x i8] }
|
||||||
|
%struct.array9 = type { [9 x i8] }
|
||||||
|
%struct.array10 = type { [10 x i8] }
|
||||||
|
%struct.array11 = type { [11 x i8] }
|
||||||
|
%struct.array12 = type { [12 x i8] }
|
||||||
|
%struct.array13 = type { [13 x i8] }
|
||||||
|
%struct.array14 = type { [14 x i8] }
|
||||||
|
%struct.array15 = type { [15 x i8] }
|
||||||
|
%struct.array16 = type { [16 x i8] }
|
||||||
|
%struct.array17 = type { [17 x i8] }
|
||||||
|
%struct.array18 = type { [18 x i8] }
|
||||||
|
%struct.array19 = type { [19 x i8] }
|
||||||
|
%struct.array20 = type { [20 x i8] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 1
|
||||||
|
%3 = alloca %struct.array1, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
%6 = trunc i32 %0 to i8
|
||||||
|
store i8 %6, ptr %5, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 1, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 1 %7, i32 1, i1 false)
|
||||||
|
%8 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo2(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 1
|
||||||
|
%3 = alloca %struct.array2, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
%6 = trunc i32 %0 to i16
|
||||||
|
store i16 %6, ptr %5, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 2, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 1 %7, i32 2, i1 false)
|
||||||
|
%8 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo3(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array3, align 1
|
||||||
|
%3 = alloca %struct.array3, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = getelementptr inbounds %struct.array3, ptr %3, i32 0, i32 0
|
||||||
|
%6 = trunc i32 %0 to i24
|
||||||
|
store i24 %6, ptr %5, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 3, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array3, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 1 %7, i32 3, i1 false)
|
||||||
|
%8 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo4(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array4, align 1
|
||||||
|
%3 = alloca %struct.array4, align 1
|
||||||
|
%4 = getelementptr inbounds %struct.array4, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array4, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 1
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo5([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array5, align 1
|
||||||
|
%3 = alloca %struct.array5, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
%6 = getelementptr inbounds %struct.array5, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %6, ptr align 4 %4, i32 5, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 5, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array5, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %7, i32 5, i1 false)
|
||||||
|
%8 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo6([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array6, align 1
|
||||||
|
%3 = alloca %struct.array6, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
%6 = getelementptr inbounds %struct.array6, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %6, ptr align 4 %4, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 6, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array6, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %7, i32 6, i1 false)
|
||||||
|
%8 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo7([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array7, align 1
|
||||||
|
%3 = alloca %struct.array7, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
%6 = getelementptr inbounds %struct.array7, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %6, ptr align 4 %4, i32 7, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 7, i1 false)
|
||||||
|
%7 = getelementptr inbounds %struct.array7, ptr %2, i32 0, i32 0
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %7, i32 7, i1 false)
|
||||||
|
%8 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo8([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array8, align 1
|
||||||
|
%3 = alloca %struct.array8, align 1
|
||||||
|
%4 = getelementptr inbounds %struct.array8, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array8, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 1
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 9, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 10, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 11, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 13, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 14, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 15, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 17, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 18, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 19, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
246
internal/cabi/_testdata/arch/esp32c3/array_pointer.ll
Normal file
246
internal/cabi/_testdata/arch/esp32c3/array_pointer.ll
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
; ModuleID = '../../wrap/array_pointer.c'
|
||||||
|
source_filename = "../../wrap/array_pointer.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x ptr] }
|
||||||
|
%struct.array2 = type { [2 x ptr] }
|
||||||
|
%struct.array3 = type { [3 x ptr] }
|
||||||
|
%struct.array4 = type { [4 x ptr] }
|
||||||
|
%struct.array5 = type { [5 x ptr] }
|
||||||
|
%struct.array6 = type { [6 x ptr] }
|
||||||
|
%struct.array7 = type { [7 x ptr] }
|
||||||
|
%struct.array8 = type { [8 x ptr] }
|
||||||
|
%struct.array9 = type { [9 x ptr] }
|
||||||
|
%struct.array10 = type { [10 x ptr] }
|
||||||
|
%struct.array11 = type { [11 x ptr] }
|
||||||
|
%struct.array12 = type { [12 x ptr] }
|
||||||
|
%struct.array13 = type { [13 x ptr] }
|
||||||
|
%struct.array14 = type { [14 x ptr] }
|
||||||
|
%struct.array15 = type { [15 x ptr] }
|
||||||
|
%struct.array16 = type { [16 x ptr] }
|
||||||
|
%struct.array17 = type { [17 x ptr] }
|
||||||
|
%struct.array18 = type { [18 x ptr] }
|
||||||
|
%struct.array19 = type { [19 x ptr] }
|
||||||
|
%struct.array20 = type { [20 x ptr] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 4
|
||||||
|
%3 = alloca %struct.array1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 4
|
||||||
|
%3 = alloca %struct.array2, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
246
internal/cabi/_testdata/arch/esp32c3/array_uintptr.ll
Normal file
246
internal/cabi/_testdata/arch/esp32c3/array_uintptr.ll
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
; ModuleID = '../../wrap/array_uintptr.c'
|
||||||
|
source_filename = "../../wrap/array_uintptr.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array1 = type { [1 x ptr] }
|
||||||
|
%struct.array2 = type { [2 x ptr] }
|
||||||
|
%struct.array3 = type { [3 x ptr] }
|
||||||
|
%struct.array4 = type { [4 x ptr] }
|
||||||
|
%struct.array5 = type { [5 x ptr] }
|
||||||
|
%struct.array6 = type { [6 x ptr] }
|
||||||
|
%struct.array7 = type { [7 x ptr] }
|
||||||
|
%struct.array8 = type { [8 x ptr] }
|
||||||
|
%struct.array9 = type { [9 x ptr] }
|
||||||
|
%struct.array10 = type { [10 x ptr] }
|
||||||
|
%struct.array11 = type { [11 x ptr] }
|
||||||
|
%struct.array12 = type { [12 x ptr] }
|
||||||
|
%struct.array13 = type { [13 x ptr] }
|
||||||
|
%struct.array14 = type { [14 x ptr] }
|
||||||
|
%struct.array15 = type { [15 x ptr] }
|
||||||
|
%struct.array16 = type { [16 x ptr] }
|
||||||
|
%struct.array17 = type { [17 x ptr] }
|
||||||
|
%struct.array18 = type { [18 x ptr] }
|
||||||
|
%struct.array19 = type { [19 x ptr] }
|
||||||
|
%struct.array20 = type { [20 x ptr] }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array1, align 4
|
||||||
|
%3 = alloca %struct.array1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array2, align 4
|
||||||
|
%3 = alloca %struct.array2, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array2, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.array2, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.array3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.array4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.array5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.array6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.array7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.array8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.array9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.array10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.array11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.array12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.array13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.array14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.array15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.array16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.array17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.array18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.array19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.array20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
73
internal/cabi/_testdata/arch/esp32c3/basic.ll
Normal file
73
internal/cabi/_testdata/arch/esp32c3/basic.ll
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
; ModuleID = '../../wrap/basic.c'
|
||||||
|
source_filename = "../../wrap/basic.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local zeroext i8 @basic_int8(i8 noundef zeroext %0) #0 {
|
||||||
|
%2 = alloca i8, align 1
|
||||||
|
store i8 %0, ptr %2, align 1
|
||||||
|
%3 = load i8, ptr %2, align 1
|
||||||
|
ret i8 %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local signext i16 @basic_int16(i16 noundef signext %0) #0 {
|
||||||
|
%2 = alloca i16, align 2
|
||||||
|
store i16 %0, ptr %2, align 2
|
||||||
|
%3 = load i16, ptr %2, align 2
|
||||||
|
ret i16 %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @basic_int32(i32 noundef %0) #0 {
|
||||||
|
%2 = alloca i32, align 4
|
||||||
|
store i32 %0, ptr %2, align 4
|
||||||
|
%3 = load i32, ptr %2, align 4
|
||||||
|
ret i32 %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i64 @basic_int64(i64 noundef %0) #0 {
|
||||||
|
%2 = alloca i64, align 8
|
||||||
|
store i64 %0, ptr %2, align 8
|
||||||
|
%3 = load i64, ptr %2, align 8
|
||||||
|
ret i64 %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local float @basic_float32(float noundef %0) #0 {
|
||||||
|
%2 = alloca float, align 4
|
||||||
|
store float %0, ptr %2, align 4
|
||||||
|
%3 = load float, ptr %2, align 4
|
||||||
|
ret float %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local double @basic_float64(double noundef %0) #0 {
|
||||||
|
%2 = alloca double, align 8
|
||||||
|
store double %0, ptr %2, align 8
|
||||||
|
%3 = load double, ptr %2, align 8
|
||||||
|
ret double %3
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local ptr @basic_uintptr(ptr noundef %0) #0 {
|
||||||
|
%2 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %2, align 4
|
||||||
|
%3 = load ptr, ptr %2, align 4
|
||||||
|
ret ptr %3
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
128
internal/cabi/_testdata/arch/esp32c3/composite.ll
Normal file
128
internal/cabi/_testdata/arch/esp32c3/composite.ll
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
; ModuleID = '../../wrap/composite.c'
|
||||||
|
source_filename = "../../wrap/composite.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.array10 = type { %struct.basearray1 }
|
||||||
|
%struct.basearray1 = type { [1 x i32] }
|
||||||
|
%struct.array11 = type { %struct.basearray1, i32 }
|
||||||
|
%struct.point10 = type { %struct.basepoint1 }
|
||||||
|
%struct.basepoint1 = type { i32 }
|
||||||
|
%struct.point11 = type { %struct.basepoint1, i32 }
|
||||||
|
%struct.array20 = type { %struct.basearray2 }
|
||||||
|
%struct.basearray2 = type { [2 x i32] }
|
||||||
|
%struct.array21 = type { %struct.basearray2, i32 }
|
||||||
|
%struct.point20 = type { %struct.basepoint2 }
|
||||||
|
%struct.basepoint2 = type { i32, i32 }
|
||||||
|
%struct.point21 = type { %struct.basepoint2, i32 }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo_array10(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.array10, align 4
|
||||||
|
%3 = alloca %struct.array10, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array10, ptr %3, i32 0, i32 0
|
||||||
|
%5 = getelementptr inbounds %struct.basearray1, ptr %4, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %5, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.array10, ptr %2, i32 0, i32 0
|
||||||
|
%7 = getelementptr inbounds %struct.basearray1, ptr %6, i32 0, i32 0
|
||||||
|
%8 = load i32, ptr %7, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo_array11([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array11, align 4
|
||||||
|
%3 = alloca %struct.array11, align 4
|
||||||
|
store [2 x i32] %0, ptr %3, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 4
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo_point10(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point10, align 4
|
||||||
|
%3 = alloca %struct.point10, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.point10, ptr %3, i32 0, i32 0
|
||||||
|
%5 = getelementptr inbounds %struct.basepoint1, ptr %4, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %5, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.point10, ptr %2, i32 0, i32 0
|
||||||
|
%7 = getelementptr inbounds %struct.basepoint1, ptr %6, i32 0, i32 0
|
||||||
|
%8 = load i32, ptr %7, align 4
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo_point11([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point11, align 4
|
||||||
|
%3 = alloca %struct.point11, align 4
|
||||||
|
store [2 x i32] %0, ptr %3, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 4
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo_array20([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.array20, align 4
|
||||||
|
%3 = alloca %struct.array20, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.array20, ptr %3, i32 0, i32 0
|
||||||
|
%5 = getelementptr inbounds %struct.basearray2, ptr %4, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %5, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.array20, ptr %2, i32 0, i32 0
|
||||||
|
%7 = getelementptr inbounds %struct.basearray2, ptr %6, i32 0, i32 0
|
||||||
|
%8 = load [2 x i32], ptr %7, align 4
|
||||||
|
ret [2 x i32] %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo_array21(ptr dead_on_unwind noalias writable sret(%struct.array21) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo_point20([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point20, align 4
|
||||||
|
%3 = alloca %struct.point20, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.point20, ptr %3, i32 0, i32 0
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.point20, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo_point21(ptr dead_on_unwind noalias writable sret(%struct.point21) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
63
internal/cabi/_testdata/arch/esp32c3/empty.ll
Normal file
63
internal/cabi/_testdata/arch/esp32c3/empty.ll
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
; ModuleID = '../../wrap/empty.c'
|
||||||
|
source_filename = "../../wrap/empty.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.empty = type {}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo0() #0 {
|
||||||
|
%1 = alloca %struct.empty, align 1
|
||||||
|
%2 = alloca %struct.empty, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %1, ptr align 1 %2, i32 0, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo1(i32 noundef %0) #0 {
|
||||||
|
%2 = alloca %struct.empty, align 1
|
||||||
|
%3 = alloca %struct.empty, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 0, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo2(i32 noundef %0) #0 {
|
||||||
|
%2 = alloca %struct.empty, align 1
|
||||||
|
%3 = alloca i32, align 4
|
||||||
|
store i32 %0, ptr %3, align 4
|
||||||
|
%4 = load i32, ptr %3, align 4
|
||||||
|
ret i32 %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo3(i32 noundef %0, i32 noundef %1) #0 {
|
||||||
|
%3 = alloca %struct.empty, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = alloca i32, align 4
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
store i32 %1, ptr %5, align 4
|
||||||
|
%6 = load i32, ptr %4, align 4
|
||||||
|
%7 = load i32, ptr %5, align 4
|
||||||
|
%8 = add nsw i32 %6, %7
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/struct_float32.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/struct_float32.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_float32.c'
|
||||||
|
source_filename = "../../wrap/struct_float32.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { float }
|
||||||
|
%struct.point2 = type { float, float }
|
||||||
|
%struct.point3 = type { float, float, float }
|
||||||
|
%struct.point4 = type { float, float, float, float }
|
||||||
|
%struct.point5 = type { float, float, float, float, float }
|
||||||
|
%struct.point6 = type { float, float, float, float, float, float }
|
||||||
|
%struct.point7 = type { float, float, float, float, float, float, float }
|
||||||
|
%struct.point8 = type { float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point9 = type { float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point10 = type { float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point11 = type { float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point12 = type { float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point13 = type { float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point14 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point15 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point16 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point17 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point18 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point19 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
%struct.point20 = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 4
|
||||||
|
%3 = alloca %struct.point1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point2, align 4
|
||||||
|
%3 = alloca %struct.point2, align 4
|
||||||
|
store [2 x i32] %0, ptr %3, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 4
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.point3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.point4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/struct_float64.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/struct_float64.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_float64.c'
|
||||||
|
source_filename = "../../wrap/struct_float64.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { double }
|
||||||
|
%struct.point2 = type { double, double }
|
||||||
|
%struct.point3 = type { double, double, double }
|
||||||
|
%struct.point4 = type { double, double, double, double }
|
||||||
|
%struct.point5 = type { double, double, double, double, double }
|
||||||
|
%struct.point6 = type { double, double, double, double, double, double }
|
||||||
|
%struct.point7 = type { double, double, double, double, double, double, double }
|
||||||
|
%struct.point8 = type { double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point9 = type { double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point10 = type { double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point11 = type { double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point12 = type { double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point13 = type { double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point14 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point15 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point16 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point17 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point18 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point19 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
%struct.point20 = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i64 @demo1(i64 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 8
|
||||||
|
%3 = alloca %struct.point1, align 8
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
store i64 %0, ptr %4, align 8
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %2, ptr align 8 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i64, ptr %5, align 8
|
||||||
|
ret i64 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo2(ptr dead_on_unwind noalias writable sret(%struct.point2) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.point3) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.point4) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 88, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 96, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 104, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 112, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 120, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 128, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 136, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 144, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 152, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 160, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
250
internal/cabi/_testdata/arch/esp32c3/struct_int16.ll
Normal file
250
internal/cabi/_testdata/arch/esp32c3/struct_int16.ll
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_int16.c'
|
||||||
|
source_filename = "../../wrap/struct_int16.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { i16 }
|
||||||
|
%struct.point2 = type { i16, i16 }
|
||||||
|
%struct.point3 = type { i16, i16, i16 }
|
||||||
|
%struct.point4 = type { i16, i16, i16, i16 }
|
||||||
|
%struct.point5 = type { i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point6 = type { i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point7 = type { i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point8 = type { i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point9 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point10 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point11 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point12 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point13 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point14 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point15 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point16 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point17 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point18 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point19 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
%struct.point20 = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 2
|
||||||
|
%3 = alloca %struct.point1, align 2
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
%5 = trunc i32 %0 to i16
|
||||||
|
store i16 %5, ptr %4, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 2, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%7 = load i16, ptr %6, align 2
|
||||||
|
%8 = zext i16 %7 to i32
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo2(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point2, align 2
|
||||||
|
%3 = alloca %struct.point2, align 2
|
||||||
|
store i32 %0, ptr %3, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 4, i1 false)
|
||||||
|
%4 = load i32, ptr %2, align 2
|
||||||
|
ret i32 %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo3([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point3, align 2
|
||||||
|
%3 = alloca %struct.point3, align 2
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %3, ptr align 4 %4, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 2 %2, i32 6, i1 false)
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo4([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point4, align 2
|
||||||
|
%3 = alloca %struct.point4, align 2
|
||||||
|
store [2 x i32] %0, ptr %3, align 2
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %2, ptr align 2 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 2
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 10, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 14, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 18, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 22, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 26, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 30, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 34, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 38, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 2 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 2 %0, ptr align 2 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/struct_int32.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/struct_int32.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_int32.c'
|
||||||
|
source_filename = "../../wrap/struct_int32.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { i32 }
|
||||||
|
%struct.point2 = type { i32, i32 }
|
||||||
|
%struct.point3 = type { i32, i32, i32 }
|
||||||
|
%struct.point4 = type { i32, i32, i32, i32 }
|
||||||
|
%struct.point5 = type { i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point6 = type { i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point7 = type { i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point8 = type { i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point9 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point10 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point11 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point12 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point13 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point14 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point15 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point16 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point17 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point18 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point19 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
%struct.point20 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 4
|
||||||
|
%3 = alloca %struct.point1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
store i32 %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i32, ptr %5, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point2, align 4
|
||||||
|
%3 = alloca %struct.point2, align 4
|
||||||
|
store [2 x i32] %0, ptr %3, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 4
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.point3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.point4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
244
internal/cabi/_testdata/arch/esp32c3/struct_int64.ll
Normal file
244
internal/cabi/_testdata/arch/esp32c3/struct_int64.ll
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_int64.c'
|
||||||
|
source_filename = "../../wrap/struct_int64.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { i64 }
|
||||||
|
%struct.point2 = type { i64, i64 }
|
||||||
|
%struct.point3 = type { i64, i64, i64 }
|
||||||
|
%struct.point4 = type { i64, i64, i64, i64 }
|
||||||
|
%struct.point5 = type { i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point6 = type { i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point7 = type { i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point8 = type { i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point9 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point10 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point11 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point12 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point13 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point14 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point15 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point16 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point17 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point18 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point19 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
%struct.point20 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i64 @demo1(i64 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 8
|
||||||
|
%3 = alloca %struct.point1, align 8
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
store i64 %0, ptr %4, align 8
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %2, ptr align 8 %3, i32 8, i1 false)
|
||||||
|
%5 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%6 = load i64, ptr %5, align 8
|
||||||
|
ret i64 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo2(ptr dead_on_unwind noalias writable sret(%struct.point2) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.point3) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.point4) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 88, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 96, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 104, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 112, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 120, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 128, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 136, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 144, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 152, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 8 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 8 %0, ptr align 8 %1, i32 160, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
264
internal/cabi/_testdata/arch/esp32c3/struct_int8.ll
Normal file
264
internal/cabi/_testdata/arch/esp32c3/struct_int8.ll
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_int8.c'
|
||||||
|
source_filename = "../../wrap/struct_int8.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { i8 }
|
||||||
|
%struct.point2 = type { i8, i8 }
|
||||||
|
%struct.point3 = type { i8, i8, i8 }
|
||||||
|
%struct.point4 = type { i8, i8, i8, i8 }
|
||||||
|
%struct.point5 = type { i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point6 = type { i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point7 = type { i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point8 = type { i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point9 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point10 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point11 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point12 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point13 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point14 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point15 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point16 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point17 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point18 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point19 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
%struct.point20 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 1
|
||||||
|
%3 = alloca %struct.point1, align 1
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
%5 = trunc i32 %0 to i8
|
||||||
|
store i8 %5, ptr %4, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 1, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%7 = load i8, ptr %6, align 1
|
||||||
|
%8 = zext i8 %7 to i32
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo2(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point2, align 1
|
||||||
|
%3 = alloca %struct.point2, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = trunc i32 %0 to i16
|
||||||
|
store i16 %5, ptr %3, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 2, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 1 %2, i32 2, i1 false)
|
||||||
|
%6 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo3(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point3, align 1
|
||||||
|
%3 = alloca %struct.point3, align 1
|
||||||
|
%4 = alloca i32, align 4
|
||||||
|
%5 = trunc i32 %0 to i24
|
||||||
|
store i24 %5, ptr %3, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 3, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %4, ptr align 1 %2, i32 3, i1 false)
|
||||||
|
%6 = load i32, ptr %4, align 4
|
||||||
|
ret i32 %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo4(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point4, align 1
|
||||||
|
%3 = alloca %struct.point4, align 1
|
||||||
|
store i32 %0, ptr %3, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 4, i1 false)
|
||||||
|
%4 = load i32, ptr %2, align 1
|
||||||
|
ret i32 %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo5([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point5, align 1
|
||||||
|
%3 = alloca %struct.point5, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %3, ptr align 4 %4, i32 5, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 5, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %2, i32 5, i1 false)
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo6([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point6, align 1
|
||||||
|
%3 = alloca %struct.point6, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %3, ptr align 4 %4, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 6, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %2, i32 6, i1 false)
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo7([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point7, align 1
|
||||||
|
%3 = alloca %struct.point7, align 1
|
||||||
|
%4 = alloca [2 x i32], align 4
|
||||||
|
%5 = alloca [2 x i32], align 4
|
||||||
|
store [2 x i32] %0, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %3, ptr align 4 %4, i32 7, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 7, i1 false)
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %5, ptr align 1 %2, i32 7, i1 false)
|
||||||
|
%6 = load [2 x i32], ptr %5, align 4
|
||||||
|
ret [2 x i32] %6
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo8([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point8, align 1
|
||||||
|
%3 = alloca %struct.point8, align 1
|
||||||
|
store [2 x i32] %0, ptr %3, align 1
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %2, ptr align 1 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 1
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 9, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 10, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 11, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 13, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 14, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 15, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 17, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 18, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 19, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 1 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
11600
internal/cabi/_testdata/arch/esp32c3/struct_mixed.ll
Normal file
11600
internal/cabi/_testdata/arch/esp32c3/struct_mixed.ll
Normal file
File diff suppressed because it is too large
Load Diff
246
internal/cabi/_testdata/arch/esp32c3/struct_uintptr.ll
Normal file
246
internal/cabi/_testdata/arch/esp32c3/struct_uintptr.ll
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
; ModuleID = '../../wrap/struct_uintptr.c'
|
||||||
|
source_filename = "../../wrap/struct_uintptr.c"
|
||||||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||||
|
target triple = "riscv32-esp-unknown-elf"
|
||||||
|
|
||||||
|
%struct.point1 = type { ptr }
|
||||||
|
%struct.point2 = type { ptr, ptr }
|
||||||
|
%struct.point3 = type { ptr, ptr, ptr }
|
||||||
|
%struct.point4 = type { ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point5 = type { ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point6 = type { ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point7 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point8 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point9 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point10 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point11 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point12 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point13 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point14 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point15 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point16 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point17 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point18 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point19 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
%struct.point20 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local i32 @demo1(i32 %0) #0 {
|
||||||
|
%2 = alloca %struct.point1, align 4
|
||||||
|
%3 = alloca %struct.point1, align 4
|
||||||
|
%4 = getelementptr inbounds %struct.point1, ptr %3, i32 0, i32 0
|
||||||
|
%5 = inttoptr i32 %0 to ptr
|
||||||
|
store ptr %5, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 4, i1 false)
|
||||||
|
%6 = getelementptr inbounds %struct.point1, ptr %2, i32 0, i32 0
|
||||||
|
%7 = load ptr, ptr %6, align 4
|
||||||
|
%8 = ptrtoint ptr %7 to i32
|
||||||
|
ret i32 %8
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
|
||||||
|
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local [2 x i32] @demo2([2 x i32] %0) #0 {
|
||||||
|
%2 = alloca %struct.point2, align 4
|
||||||
|
%3 = alloca %struct.point2, align 4
|
||||||
|
store [2 x i32] %0, ptr %3, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %2, ptr align 4 %3, i32 8, i1 false)
|
||||||
|
%4 = load [2 x i32], ptr %2, align 4
|
||||||
|
ret [2 x i32] %4
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo3(ptr dead_on_unwind noalias writable sret(%struct.point3) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 12, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo4(ptr dead_on_unwind noalias writable sret(%struct.point4) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 16, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo5(ptr dead_on_unwind noalias writable sret(%struct.point5) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 20, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo6(ptr dead_on_unwind noalias writable sret(%struct.point6) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 24, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo7(ptr dead_on_unwind noalias writable sret(%struct.point7) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 28, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo8(ptr dead_on_unwind noalias writable sret(%struct.point8) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 32, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo9(ptr dead_on_unwind noalias writable sret(%struct.point9) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 36, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo10(ptr dead_on_unwind noalias writable sret(%struct.point10) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 40, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo11(ptr dead_on_unwind noalias writable sret(%struct.point11) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 44, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo12(ptr dead_on_unwind noalias writable sret(%struct.point12) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 48, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo13(ptr dead_on_unwind noalias writable sret(%struct.point13) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 52, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo14(ptr dead_on_unwind noalias writable sret(%struct.point14) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 56, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo15(ptr dead_on_unwind noalias writable sret(%struct.point15) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 60, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo16(ptr dead_on_unwind noalias writable sret(%struct.point16) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 64, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo17(ptr dead_on_unwind noalias writable sret(%struct.point17) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 68, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo18(ptr dead_on_unwind noalias writable sret(%struct.point18) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 72, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo19(ptr dead_on_unwind noalias writable sret(%struct.point19) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 76, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
; Function Attrs: noinline nounwind optnone
|
||||||
|
define dso_local void @demo20(ptr dead_on_unwind noalias writable sret(%struct.point20) align 4 %0, ptr noundef %1) #0 {
|
||||||
|
%3 = alloca ptr, align 4
|
||||||
|
%4 = alloca ptr, align 4
|
||||||
|
store ptr %0, ptr %3, align 4
|
||||||
|
store ptr %1, ptr %4, align 4
|
||||||
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %1, i32 80, i1 false)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv32" "target-features"="+32bit,+a,+c,+m,+relax,+zmmul,-b,-d,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-f,-h,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-v,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xesppie,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xtheadvdot,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zicsr,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-ztso,-zvbb,-zvbc,-zve32f,-zve32x,-zve64d,-zve64f,-zve64x,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl128b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl32b,-zvl4096b,-zvl512b,-zvl64b,-zvl65536b,-zvl8192b" }
|
||||||
|
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
|
||||||
|
|
||||||
|
!llvm.module.flags = !{!0, !1, !2, !4, !5}
|
||||||
|
!llvm.ident = !{!6}
|
||||||
|
|
||||||
|
!0 = !{i32 1, !"wchar_size", i32 4}
|
||||||
|
!1 = !{i32 1, !"target-abi", !"ilp32"}
|
||||||
|
!2 = !{i32 6, !"riscv-isa", !3}
|
||||||
|
!3 = !{!"rv32i2p1_m2p0_a2p1_c2p0_zmmul1p0"}
|
||||||
|
!4 = !{i32 7, !"frame-pointer", i32 2}
|
||||||
|
!5 = !{i32 8, !"SmallDataLimit", i32 8}
|
||||||
|
!6 = !{!"clang version 19.1.2 (https://github.com/espressif/llvm-project 510a078c1ad4aee4460818bcb38ff0ba3fbf6a83)"}
|
||||||
@@ -327,7 +327,7 @@ type TypeInfoRiscv64 struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *TypeInfoRiscv64) SupportByVal() bool {
|
func (p *TypeInfoRiscv64) SupportByVal() bool {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *TypeInfoRiscv64) SkipEmptyParams() bool {
|
func (p *TypeInfoRiscv64) SkipEmptyParams() bool {
|
||||||
@@ -380,6 +380,76 @@ func (p *TypeInfoRiscv64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm
|
|||||||
return info
|
return info
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
MABI_LP64 = "lp64"
|
||||||
|
MABI_LP64D = "lp64d"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MABI_ILP32 = "ilp32"
|
||||||
|
MABI_ILP32F = "ilp32f"
|
||||||
|
MABI_ILP32D = "ilp32d"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TypeInfoRiscv32 struct {
|
||||||
|
*Transformer
|
||||||
|
mabi string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *TypeInfoRiscv32) SupportByVal() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *TypeInfoRiscv32) SkipEmptyParams() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *TypeInfoRiscv32) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool {
|
||||||
|
switch typ.TypeKind() {
|
||||||
|
case llvm.StructTypeKind, llvm.ArrayTypeKind:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *TypeInfoRiscv32) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo {
|
||||||
|
info := &TypeInfo{}
|
||||||
|
info.Type = typ
|
||||||
|
info.Type1 = typ
|
||||||
|
if typ.TypeKind() == llvm.VoidTypeKind {
|
||||||
|
info.Kind = AttrVoid
|
||||||
|
return info
|
||||||
|
}
|
||||||
|
info.Size = p.Sizeof(typ)
|
||||||
|
info.Align = p.Alignof(typ)
|
||||||
|
switch typ.TypeKind() {
|
||||||
|
case llvm.StructTypeKind, llvm.ArrayTypeKind:
|
||||||
|
types := elementTypes(p.td, typ)
|
||||||
|
switch len(types) {
|
||||||
|
case 1:
|
||||||
|
if types[0] == ctx.Int64Type() {
|
||||||
|
return info
|
||||||
|
}
|
||||||
|
if types[0] == ctx.DoubleType() {
|
||||||
|
info.Kind = AttrWidthType
|
||||||
|
info.Type1 = ctx.Int64Type()
|
||||||
|
return info
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if info.Size > 8 {
|
||||||
|
info.Kind = AttrPointer
|
||||||
|
info.Type1 = llvm.PointerType(typ, 0)
|
||||||
|
} else if info.Size <= 4 {
|
||||||
|
info.Kind = AttrWidthType
|
||||||
|
info.Type1 = ctx.Int32Type()
|
||||||
|
} else {
|
||||||
|
info.Kind = AttrWidthType
|
||||||
|
info.Type1 = llvm.ArrayType(ctx.Int32Type(), 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info
|
||||||
|
}
|
||||||
|
|
||||||
type TypeInfo386 struct {
|
type TypeInfo386 struct {
|
||||||
*Transformer
|
*Transformer
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const (
|
|||||||
ModeAllFunc
|
ModeAllFunc
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTransformer(prog ssa.Program, targetName string, mode Mode, optimize bool) *Transformer {
|
func NewTransformer(prog ssa.Program, targetName string, targetAbi string, mode Mode, optimize bool) *Transformer {
|
||||||
target := prog.Target()
|
target := prog.Target()
|
||||||
tr := &Transformer{
|
tr := &Transformer{
|
||||||
prog: prog,
|
prog: prog,
|
||||||
@@ -29,6 +29,9 @@ func NewTransformer(prog ssa.Program, targetName string, mode Mode, optimize boo
|
|||||||
case "esp32":
|
case "esp32":
|
||||||
tr.sys = &TypeInfoEsp32{tr}
|
tr.sys = &TypeInfoEsp32{tr}
|
||||||
return tr
|
return tr
|
||||||
|
case "esp32c3":
|
||||||
|
tr.sys = &TypeInfoRiscv32{tr, targetAbi}
|
||||||
|
return tr
|
||||||
}
|
}
|
||||||
switch target.GOARCH {
|
switch target.GOARCH {
|
||||||
case "amd64":
|
case "amd64":
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ func init() {
|
|||||||
archDir = append(archDir, "wasm32")
|
archDir = append(archDir, "wasm32")
|
||||||
archs = append(archs, "esp32")
|
archs = append(archs, "esp32")
|
||||||
archDir = append(archDir, "esp32")
|
archDir = append(archDir, "esp32")
|
||||||
|
archs = append(archs, "esp32c3")
|
||||||
|
archDir = append(archDir, "esp32c3")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,6 +44,8 @@ func buildConf(mode cabi.Mode, arch string) *build.Config {
|
|||||||
conf.Goos = "wasip1"
|
conf.Goos = "wasip1"
|
||||||
case "esp32":
|
case "esp32":
|
||||||
conf.Target = "esp32"
|
conf.Target = "esp32"
|
||||||
|
case "esp32c3":
|
||||||
|
conf.Target = "esp32c3"
|
||||||
}
|
}
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
@@ -141,7 +145,7 @@ func testFunc(t *testing.T, ctx context, td llvm.TargetData, fn llvm.Value, cfn
|
|||||||
t.Fatalf("%v %v: bad param attr type %v != %v", ctx, fn.Name(), ft, cft)
|
t.Fatalf("%v %v: bad param attr type %v != %v", ctx, fn.Name(), ft, cft)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if fn.GetStringAttributeAtIndex(1, "byval") != cfn.GetStringAttributeAtIndex(1, "byval") {
|
if fn.GetStringAttributeAtIndex(i+1, "byval") != cfn.GetStringAttributeAtIndex(i+1, "byval") {
|
||||||
t.Fatalf("%v %v: bad param attr type %v != %v", ctx, fn.Name(), ft, cft)
|
t.Fatalf("%v %v: bad param attr type %v != %v", ctx, fn.Name(), ft, cft)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ type Export struct {
|
|||||||
ClangRoot string // Root directory of custom clang installation
|
ClangRoot string // Root directory of custom clang installation
|
||||||
ClangBinPath string // Path to clang binary directory
|
ClangBinPath string // Path to clang binary directory
|
||||||
|
|
||||||
|
TargetABI string // RISC-V Target ABI (e.g., "lp64", "lp64d")
|
||||||
BinaryFormat string // Binary format (e.g., "elf", "esp", "uf2")
|
BinaryFormat string // Binary format (e.g., "elf", "esp", "uf2")
|
||||||
FormatDetail string // For uf2, it's uf2FamilyID
|
FormatDetail string // For uf2, it's uf2FamilyID
|
||||||
Emulator string // Emulator command template (e.g., "qemu-system-arm -M {} -kernel {}")
|
Emulator string // Emulator command template (e.g., "qemu-system-arm -M {} -kernel {}")
|
||||||
@@ -453,6 +454,7 @@ func UseTarget(targetName string) (export Export, err error) {
|
|||||||
export.GOOS = config.GOOS
|
export.GOOS = config.GOOS
|
||||||
export.GOARCH = config.GOARCH
|
export.GOARCH = config.GOARCH
|
||||||
export.ExtraFiles = config.ExtraFiles
|
export.ExtraFiles = config.ExtraFiles
|
||||||
|
export.TargetABI = config.TargetABI
|
||||||
export.BinaryFormat = config.BinaryFormat
|
export.BinaryFormat = config.BinaryFormat
|
||||||
export.FormatDetail = config.FormatDetail()
|
export.FormatDetail = config.FormatDetail()
|
||||||
export.Emulator = config.Emulator
|
export.Emulator = config.Emulator
|
||||||
|
|||||||
Reference in New Issue
Block a user