Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip round-trip tests for structs with FAMs #3254

Merged
merged 1 commit into from May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions libc-test/build.rs
Expand Up @@ -3333,15 +3333,15 @@ fn test_linux(target: &str) {
"Ioctl" if gnu => "unsigned long".to_string(),
"Ioctl" => "int".to_string(),

t if is_union => format!("union {}", t),

t if t.ends_with("_t") => t.to_string(),

// In MUSL `flock64` is a typedef to `flock`.
"flock64" if musl => format!("struct {}", ty),

// typedefs don't need any keywords
t if t.ends_with("_t") => t.to_string(),
// put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),
// put `union` in front of all unions:
t if is_union => format!("union {}", t),

t => t.to_string(),
}
Expand Down Expand Up @@ -3390,7 +3390,8 @@ fn test_linux(target: &str) {
// on Linux, this is a volatile int
"pthread_spinlock_t" => true,

// For internal use only, to define architecture specific ioctl constants with a libc specific type.
// For internal use only, to define architecture specific ioctl constants with a libc
// specific type.
"Ioctl" => true,

// FIXME: requires >= 5.4.1 kernel headers
Expand Down Expand Up @@ -3964,6 +3965,13 @@ fn test_linux(target: &str) {
true
}

// The `inotify_event` and `cmsghdr` types contain Flexible Array Member fields (the
// `name` and `data` fields respectively) which have unspecified calling convention.
// The roundtripping tests deliberately pass the structs by value to check "by value"
// layout consistency, but this would be UB for the these types.
"inotify_event" => true,
"cmsghdr" => true,

// FIXME: the call ABI of max_align_t is incorrect on these platforms:
"max_align_t" if i686 || mips64 || ppc64 => true,

Expand Down