<div dir="ltr">You could try something like this:<div><br></div><div>template <int N></div><div>class X{}</div><div><br></div><div>static X<SOME_INT> x;</div><div><br></div><div>// or</div><div><br></div><div>char str[SOME_INT];</div><div><br></div><div>then compile it like this:</div><div><br></div><div>clang++ -D$RANDOM -c file.cpp -o file.o</div><div><br></div><div>RANDOM is a bash thing, but basically you just need to generate a random number each time you compile and pass it in as a macro.</div><div><br></div><div>hth...</div><div>don</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 24, 2015 at 12:57 AM, Stephan Gatzka via cfe-users <span dir="ltr"><<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Hi!<br>
<br>
I just added support for reproducible builds (-frandom-seed=) into the<br>
qbs build system.<br>
<br>
For a automated test case I'd like to have a small snippet of C/C++<br>
code, which definitely leads to different object files if compiled<br>
twice.<br>
<br>
I wasn't able to write such a snippet, so any help would be very<br>
appreciated.<br>
<br>
Regards,<br>
<br>
Stephan<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</div></div></blockquote></div><br></div>