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

miscompilation #14

Closed
andrewchambers opened this issue Sep 14, 2015 · 0 comments
Closed

miscompilation #14

andrewchambers opened this issue Sep 14, 2015 · 0 comments

Comments

@andrewchambers
Copy link
Owner

@andrewchambers andrewchambers commented Sep 14, 2015

struct s {
    char a;
    char b;
};

void abort(void);

struct s
f()
{
    struct s r;
    r.a = 1;
    r.b = 2;
    return r;
}
int
main()
{
    struct s r;
    r = f();
    if(r.a != 1) abort();
    if(r.b != 2) abort();
    return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant