Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <new>
- #include <stdio.h>
- struct F
- {
- float f,g;
- };
- struct I
- {
- int i[2];
- };
- struct I ginput;
- struct I* __attribute__((noipa))
- get_I ()
- {
- return &ginput;
- }
- volatile float float_input;
- float __attribute__((noipa))
- get_float_1 ()
- {
- return float_input + 1;
- }
- struct I goutput;
- struct F gf_distraction;
- int never_true;
- void __attribute__((noipa))
- foo ()
- {
- struct I s;
- if (never_true)
- {
- struct F *p = new (&s) F;
- p->f = get_float_1 ();
- p->g = get_float_1 ();
- gf_distraction = *p;
- }
- else
- {
- struct I *t = get_I ();
- s = *t;
- goutput = s;
- }
- }
- int
- main ()
- {
- ginput.i[0] = 15;
- ginput.i[1] = -202;
- foo();
- fprintf (stderr, "goutput[0]: %i\n", goutput.i[0]);
- fprintf (stderr, "goutput[1]: %i\n", goutput.i[1]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement