From 9121f0a439992825f4e38af5d61170f3e3aeff26 Mon Sep 17 00:00:00 2001 From: Andrei Stefanescu Date: Thu, 7 Feb 2019 16:18:51 -0800 Subject: [PATCH] [refinement] Add llvm compiled binary files. --- refinement/tests/samples/switching_llvm.c | 22 ++++++ .../tests/samples/switching_llvm.x86.exe | Bin 0 -> 10392 bytes .../tests/samples/switching_many_llvm.c | 65 ++++++++++++++++++ .../tests/samples/switching_many_llvm.x86.exe | Bin 0 -> 10848 bytes 4 files changed, 87 insertions(+) create mode 100644 refinement/tests/samples/switching_llvm.c create mode 100755 refinement/tests/samples/switching_llvm.x86.exe create mode 100644 refinement/tests/samples/switching_many_llvm.c create mode 100755 refinement/tests/samples/switching_many_llvm.x86.exe diff --git a/refinement/tests/samples/switching_llvm.c b/refinement/tests/samples/switching_llvm.c new file mode 100644 index 00000000..6bd5d77c --- /dev/null +++ b/refinement/tests/samples/switching_llvm.c @@ -0,0 +1,22 @@ +#include + +int64_t __ucmpdi2() {}; +int64_t select(int64_t a, int64_t b) +{ + switch (a) { + case 0: return b; + case 1: return b+1; + case 2: return b<<1; + case 3: return b+b; + case 4: return b<<2; + case 5: return b+5; + default: return 0; + } + // Has a "jmp rax", which is a classify failure "stmtsTerm = unknown transfer" +} + +void _start() +{ + int64_t r = select(3, 4); + return; +} diff --git a/refinement/tests/samples/switching_llvm.x86.exe b/refinement/tests/samples/switching_llvm.x86.exe new file mode 100755 index 0000000000000000000000000000000000000000..6ecc0a14f98e6fc41c8f2223001d9916b223efbf GIT binary patch literal 10392 zcmeHN%WoS+82@(db=*8`HwmRtk+MLlLJ{7iDlKXuq@+e}Fj6UM1QL;1+Z%h8^@H7Y z9u*Y`^NEGc2`{ZmdXNAmayauCc&LKM>-O!+zlAn(RS_{6J#`2gOe5kK^>M)Fvt#mnNEw z55Gq)#E02@8^0xPgwSu^xY5Uwdb^=ZdFZ3bLyr$dFqvvmeY$x zy=XjH!XnGCF_9}*3w6tIw6dPp7c|?LH7iEhsJNPII4(lO2l;Rx9f9^oF-%)SGQeo7ECu^ zGAqTbWzCn9d2kHN$h#ozl@7)Rlu#`3;DOjT&kyaD`tcwBauUdx*dL0W=sDSQX5cye z!VpSgaXWZuh=s!n$gMiOW^iv60V7B6sp#4VX9ifu0MQW$#m0MjdhiRxb$r198Ky*7zFezzdL^gjf#ToW zpgRK6^p_<2Bl6|NH^~|#JaktuB`Ig9I%YYUf z!l#X*&i(B~L$nqSZOE9FIm14oW-_PQg70nfZXBSm*X@R78-V{2A5 zuUp!rVOcslxHB|wUul+^)4cu0eY29c>ILL^+djhH9JheKAX)ORz`&l?;tVSLx~CNQ zPU-9ZR#75Tp$pL|WiaxS(ib6pS$P0;-|oy9!ld^Vh>j`o?&xbuPvli46nRmO;7`M; z?9eC`hQGFg>3$6K1AYYKyN0$CHM%!K@y>lg@ke>QbC*#Zl6JMAyE-I|Qg+tX%LXJ} zW6_0V!N}E%xcIhj>bab4%=?~MnXURZ9tWLnt)8o3M~o&J-)o|?qq8MC9kl5?D&d3k1QmnWZZp-Ad|Doc zf+P6&u~rcpw^inS+!;hWSW5>=Fh-E+he@(yhFMGoYsWDhj8SFek^9#NYhT&{-^KCA zST`*h#Lw)2f0pB)Xd#&q#Fsff$bX6BCw9R5{mgTGpbV~Y{O^H;kMqOtq9OZEhyH|K xd~AzM0bV!r>iqq;pT|E!ji<@BmY|J+?Ng>&GC2Mf%-j!uo#PL;kjx0;{{=6_lC%H- literal 0 HcmV?d00001 diff --git a/refinement/tests/samples/switching_many_llvm.c b/refinement/tests/samples/switching_many_llvm.c new file mode 100644 index 00000000..b450b2e1 --- /dev/null +++ b/refinement/tests/samples/switching_many_llvm.c @@ -0,0 +1,65 @@ +#include + +// Similar to switching.c, but switching.c has only a single instance +// in a single function and this has multiple instances in multiple +// functions. + +int64_t __ucmpdi2() {}; +int64_t reflect(int64_t a, int64_t b, int64_t c) +{ + switch (b) { + case 0: return b+5; + case 1: return a+b; + case 3: return a<>2; + case 3: return b>>2; + case 4: return a^2; + case 5: return b^2; + default: return 1; + } + default: return ~0; + } + default: return 0; + } +} + +int64_t select(int64_t a, int64_t b) +{ + switch (a) { + case 0: return b; + case 1: return b+1; + case 2: return b<<1; + case 3: return b+b; + case 4: return b<<2; + case 5: switch (b) { + case 0 : return b+5; + case 1 : return a+b; + // specifically missing case 2, should still generate a + // jump expression. + case 3 : return a<J-M0L+fMGy>CGG$cA%IXRt3zouLP~&0mf78DyJ3Io?rZ^- zkWjQ)YYYUVFC_ZlgAW>ckOU$oZBW`YDk!mm_)?6Rk`SyxBZ>B)0=-a!0fjWw6$^?yQ-%KAO*2MwebDwa z&%2xB$hvOxVS2_N`@mG!>o@X}4WgMU7xS!(-9FK84#qm9k^>u7M z3ddC(w{YCaF~+f<<7tjRa{Q3vAjfYx&fo=;UfcoFp@1}ZdZqUSZo)j|=^Cg3s3M;y zeSue9%{877I&j-Y#4~9Bk~U4)-NO=jQ0((~?e_yLD6`Ki*k49_cK~1mVj;eV>u+)_cc;>NTXV`1{_%4{R88P3xcjxgserc>}d^t#?4y@}YaTjxzIv=0=i; zlpy-s#`> zged0wf)Go7TM&iXUBTK7`}^X|aD~R5kP739GZbd#;u(5I5G7}5J>$l;{r?uYC0{bq0;WVcLP6eC_I2CXz;8eh=fKvgd0!{^-3jCid5KozpuL+x=wr7n@ zR@GCnj1gB4rZWfBPCb#1XVq*jZZT64x+ILK2|8pT3K57V^i-$PgG0yDDP?VN zWpI_U%+x!x>W)xr2uBUCUAaodw0dGWB+}@M6NYfs)H5bz55~=CS3K1jPU@+{;Y6Y* z8H_^Kuttz-rNzE_+3gF=p6mN~OJl86hrj>3fhdPDWL`pu01?jSlB$)$~q zu8_f1@WZzb%DpJiv!=|Wau#f>XNdv4i@@#MR9#(-pB5+Zq7RbDN=LDu4i_v9bwd71 zz;^t|=@JV4rY`L=sIR<%y*t3Y=*M(vSDFl7GE}%ucGDLP1+D8yskZ;6f(GufS_L)s zgS)ir8D?3FG zcCugvj#B|C%p^(D@4gxWi8TCEbJ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