aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/struct_align1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/struct_align1.rs')
-rw-r--r--gcc/testsuite/rust/compile/struct_align1.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/struct_align1.rs b/gcc/testsuite/rust/compile/struct_align1.rs
new file mode 100644
index 0000000..22eb6bc
--- /dev/null
+++ b/gcc/testsuite/rust/compile/struct_align1.rs
@@ -0,0 +1,19 @@
+#[repr(align(8))]
+struct Foo {
+ x: i16,
+ // { dg-warning "field is never read" "" { target *-*-* } .-1 }
+ y: i8,
+ // { dg-warning "field is never read" "" { target *-*-* } .-1 }
+ z: i32,
+ // { dg-warning "field is never read" "" { target *-*-* } .-1 }
+}
+
+#[repr(align(8))]
+struct Bar(i8, i32);
+
+fn main () {
+ let f = Foo { x: 5, y: 2, z: 13 };
+ // { dg-warning "unused name" "" { target *-*-* } .-1 }
+ let b = Bar (7, 262);
+ // { dg-warning "unused name" "" { target *-*-* } .-1 }
+}