1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Source code of compress_prepared_bcj_*
6 /// This is a simple program that should make the compiler to generate
7 /// PC-relative branches, jumps, and calls. The compiled files can then
8 /// be used to test the branch conversion filters. Note that this program
9 /// itself does nothing useful.
11 /// Compiling: gcc -std=c99 -fPIC bcj_test.c
12 /// Don't optimize or strip.
14 // This code has been put into the public domain.
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 ///////////////////////////////////////////////////////////////////////////////
22 extern int jump(int a, int b);
38 // The loop generates conditional jump backwards.
45 // Put enough code here to prevent JMP SHORT on x86.
62 main(int argc, char **argv)
64 int a = call(argc, argc + 1);