fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

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