fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
456 B27 linesraw
1// ignore-license
2// Pragma needed cause of gcc bug on windows: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991
3
4#include <assert.h>
5
6#ifdef _MSC_VER
7#pragma pack(push,1)
8struct Foo {
9    char a;
10    short b;
11    char c;
12};
13#else
14#pragma pack(1)
15struct __attribute__((packed)) Foo {
16    char a;
17    short b;
18    char c;
19};
20#endif
21
22struct Foo foo(struct Foo foo) {
23    assert(foo.a == 1);
24    assert(foo.b == 2);
25    assert(foo.c == 3);
26    return foo;
27}