Skip to content

Commit

Permalink
fix some wrong tests and add some new ones
Browse files Browse the repository at this point in the history
Note that C still doesn't implement align, but as of #39 we combinatoric repr(rust) vs repr(c) and include rustcall as a calling convention, so our coverage of rust <-> rust (in particular for codegen_backend users) is significantly improved.

fixes #23
fixes #21
fixes #15
  • Loading branch information
Gankra committed Jul 1, 2024
1 parent 842036b commit 01cd394
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/tests/normal/simple.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn "print" {

fn "scale" {
inputs { _ "Point3"; factor "f32"; }
output { "Point3"; }
outputs { "Point3"; }
}

fn "add" {
Expand Down
9 changes: 9 additions & 0 deletions include/tests/procgen/struct/TwoAlignedU32s.procgen.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This was a problem for rustc (I think u32 = ulong here?)
//
// https://github.com/rust-lang/rust/issues/80127

@align 16
struct "TwoU32s" {
a "u32"
b "u32"
}
9 changes: 9 additions & 0 deletions include/tests/procgen/struct/TwoAlignedU64s.procgen.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This was a problem for rustc on ppc64le
//
// https://github.com/rust-lang/rust/issues/122767

@align 16
struct "TwoU64s" {
a "u64"
b "u64"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// An option-like enum of i32

tagged "OptI32Tagged" {
tagged "OptionI32" {
Some { _ "i32"; }
None
}
8 changes: 8 additions & 0 deletions include/tests/procgen/tagged/OptionU128.procgen.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This type was a problem for cranelift
//
// https://github.com/rust-lang/rustc_codegen_cranelift/issues/1449

tagged "OptionU128" {
Some { _ "u128"; }
None
}
1 change: 1 addition & 0 deletions include/tests/procgen/union/MultiVariantUnion.procgen.kdl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
union "MultiVariantUnion" {
_ "u32"
_ "i64"
_ "Point3"
}

struct "Point3" {
Expand Down

0 comments on commit 01cd394

Please sign in to comment.