[decompiler] handle nested conditionals and gotos better (#693)

* diff check

* try that again

* more small fixes
This commit is contained in:
water111
2021-07-11 21:59:27 -04:00
committed by GitHub
parent 0a9cc68a27
commit f6d5952498
31 changed files with 1896 additions and 2041 deletions
+334 -374
View File
@@ -541,9 +541,8 @@ TEST_F(FormRegressionTest, ExprArrayMethod2) {
" (format #t \"#(\")\n"
" (cond\n"
" ((type-type? (-> arg0 content-type) integer)\n"
" (let ((v1-1 (-> arg0 content-type symbol)))\n"
" (cond\n"
" ((= v1-1 (quote int32))\n"
" (case (-> arg0 content-type symbol) \n"
" (('int32)\n"
" (dotimes (s5-0 (-> arg0 length))\n"
" (format #t (if (zero? s5-0)\n"
" \"~D\"\n"
@@ -553,120 +552,111 @@ TEST_F(FormRegressionTest, ExprArrayMethod2) {
" )\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint32))\n"
" (dotimes (s5-1 (-> arg0 length))\n"
" (format #t (if (zero? s5-1)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint32) arg0) s5-1)\n"
" )\n"
" (('uint32)\n"
" (dotimes (s5-1 (-> arg0 length))\n"
" (format #t (if (zero? s5-1)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint32) arg0) s5-1)\n"
" )\n"
" )\n"
" ((= v1-1 (quote int64))\n"
" (dotimes (s5-2 (-> arg0 length))\n"
" (format #t (if (zero? s5-2)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int64) arg0) s5-2)\n"
" )\n"
" )\n"
" (('int64)\n"
" (dotimes (s5-2 (-> arg0 length))\n"
" (format #t (if (zero? s5-2)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int64) arg0) s5-2)\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint64))\n"
" (dotimes (s5-3 (-> arg0 length))\n"
" (format #t (if (zero? s5-3)\n"
" \"#x~X\"\n"
" \" #x~X\"\n"
" )\n"
" (-> (the-as (array uint64) arg0) s5-3)\n"
" )\n"
" )\n"
" (('uint64)\n"
" (dotimes (s5-3 (-> arg0 length))\n"
" (format #t (if (zero? s5-3)\n"
" \"#x~X\"\n"
" \" #x~X\"\n"
" )\n"
" (-> (the-as (array uint64) arg0) s5-3)\n"
" )\n"
" )\n"
" ((= v1-1 (quote int8))\n"
" (dotimes (s5-4 (-> arg0 length))\n"
" (format #t (if (zero? s5-4)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int8) arg0) s5-4)\n"
" )\n"
" )\n"
" (('int8)\n"
" (dotimes (s5-4 (-> arg0 length))\n"
" (format #t (if (zero? s5-4)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int8) arg0) s5-4)\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint8))\n"
" (dotimes (s5-5 (-> arg0 length))\n"
" (format #t (if (zero? s5-5)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint8) arg0) s5-5)\n"
" )\n"
" )\n"
" (('uint8)\n"
" (dotimes (s5-5 (-> arg0 length))\n"
" (format #t (if (zero? s5-5)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint8) arg0) s5-5)\n"
" )\n"
" )\n"
" ((= v1-1 (quote int16))\n"
" (dotimes (s5-6 (-> arg0 length))\n"
" (format #t (if (zero? s5-6)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int16) arg0) s5-6)\n"
" )\n"
" )\n"
" (('int16)\n"
" (dotimes (s5-6 (-> arg0 length))\n"
" (format #t (if (zero? s5-6)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int16) arg0) s5-6)\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint16))\n"
" (dotimes (s5-7 (-> arg0 length))\n"
" (format #t (if (zero? s5-7)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint16) arg0) s5-7)\n"
" )\n"
" )\n"
" (('uint16)\n"
" (dotimes (s5-7 (-> arg0 length))\n"
" (format #t (if (zero? s5-7)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array uint16) arg0) s5-7)\n"
" )\n"
" )\n"
" (else\n"
" (cond\n"
" ((or (= v1-1 (quote uint128)) (= v1-1 (quote int128)))\n"
" (dotimes (s5-8 (-> arg0 length))\n"
" (format #t (if (zero? s5-8)\n"
" \"#x~X\"\n"
" \" #x~X\"\n"
" )\n"
" (-> (the-as (array uint128) arg0) s5-8)\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-9 (-> arg0 length))\n"
" (format #t (if (zero? s5-9)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int32) arg0) s5-9)\n"
" )\n"
" )\n"
" )\n"
" )\n"
" (('uint128 'int128)\n"
" (dotimes (s5-8 (-> arg0 length))\n"
" (format #t (if (zero? s5-8)\n"
" \"#x~X\"\n"
" \" #x~X\"\n"
" )\n"
" (-> (the-as (array uint128) arg0) s5-8)\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-9 (-> arg0 length))\n"
" (format #t (if (zero? s5-9)\n"
" \"~D\"\n"
" \" ~D\"\n"
" )\n"
" (-> (the-as (array int32) arg0) s5-9)\n"
" )\n"
" )\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (cond\n"
" ((= (-> arg0 content-type) float)\n"
" (dotimes (s5-10 (-> arg0 length))\n"
" (if (zero? s5-10)\n"
" (format #t \"~f\" (-> (the-as (array float) arg0) s5-10))\n"
" (format #t \" ~f\" (-> (the-as (array float) arg0) s5-10))\n"
" )\n"
" )\n"
" ((= (-> arg0 content-type) float)\n"
" (dotimes (s5-10 (-> arg0 length))\n"
" (if (zero? s5-10)\n"
" (format #t \"~f\" (-> (the-as (array float) arg0) s5-10))\n"
" (format #t \" ~f\" (-> (the-as (array float) arg0) s5-10))\n"
" )\n"
" (else\n"
" (dotimes (s5-11 (-> arg0 length))\n"
" (if (zero? s5-11)\n"
" (format #t \"~A\" (-> (the-as (array basic) arg0) s5-11))\n"
" (format #t \" ~A\" (-> (the-as (array basic) arg0) s5-11))\n"
" )\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-11 (-> arg0 length))\n"
" (if (zero? s5-11)\n"
" (format #t \"~A\" (-> (the-as (array basic) arg0) s5-11))\n"
" (format #t \" ~A\" (-> (the-as (array basic) arg0) s5-11))\n"
" )\n"
" )\n"
" )\n"
@@ -1164,87 +1154,72 @@ TEST_F(FormRegressionTest, ExprArrayMethod3) {
" (format #t \"~Tdata[~D]: @ #x~X~%\" (-> arg0 allocated-length) (-> arg0 data))\n"
" (cond\n"
" ((type-type? (-> arg0 content-type) integer)\n"
" (let ((v1-1 (-> arg0 content-type symbol)))\n"
" (cond\n"
" ((= v1-1 (quote int32))\n"
" (case (-> arg0 content-type symbol) \n"
" (('int32)\n"
" (dotimes (s5-0 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-0 (-> (the-as (array int32) arg0) s5-0))\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint32))\n"
" (dotimes (s5-1 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-1 (-> (the-as (array uint32) arg0) s5-1))\n"
" (('uint32)\n"
" (dotimes (s5-1 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-1 (-> (the-as (array uint32) arg0) s5-1))\n"
" )\n"
" )\n"
" (('int64)\n"
" (dotimes (s5-2 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-2 (-> (the-as (array int64) arg0) s5-2))\n"
" )\n"
" )\n"
" (('uint64)\n"
" (dotimes (s5-3 (-> arg0 length))\n"
" (format #t \"~T [~D] #x~X~%\" s5-3 (-> (the-as (array uint64) arg0) s5-3))\n"
" )\n"
" )\n"
" (('int8)\n"
" (dotimes (s5-4 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-4 (-> (the-as (array int8) arg0) s5-4))\n"
" )\n"
" )\n"
" (('uint8)\n"
" (dotimes (s5-5 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-5 (-> (the-as (array int8) arg0) s5-5))\n"
" )\n"
" )\n"
" (('int16)\n"
" (dotimes (s5-6 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-6 (-> (the-as (array int16) arg0) s5-6))\n"
" )\n"
" )\n"
" (('uint16)\n"
" (dotimes (s5-7 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-7 (-> (the-as (array uint16) arg0) s5-7))\n"
" )\n"
" )\n"
" (('int128 'uint128)\n"
" (dotimes (s5-8 (-> arg0 length))\n"
" (format\n"
" #t\n"
" \"~T [~D] #x~X~%\"\n"
" s5-8\n"
" (-> (the-as (array uint128) arg0) s5-8)\n"
" )\n"
" )\n"
" ((= v1-1 (quote int64))\n"
" (dotimes (s5-2 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-2 (-> (the-as (array int64) arg0) s5-2))\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint64))\n"
" (dotimes (s5-3 (-> arg0 length))\n"
" (format\n"
" #t\n"
" \"~T [~D] #x~X~%\"\n"
" s5-3\n"
" (-> (the-as (array uint64) arg0) s5-3)\n"
" )\n"
" )\n"
" )\n"
" ((= v1-1 (quote int8))\n"
" (dotimes (s5-4 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-4 (-> (the-as (array int8) arg0) s5-4))\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint8))\n"
" (dotimes (s5-5 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-5 (-> (the-as (array int8) arg0) s5-5))\n"
" )\n"
" )\n"
" ((= v1-1 (quote int16))\n"
" (dotimes (s5-6 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-6 (-> (the-as (array int16) arg0) s5-6))\n"
" )\n"
" )\n"
" ((= v1-1 (quote uint16))\n"
" (dotimes (s5-7 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-7 (-> (the-as (array uint16) arg0) s5-7))\n"
" )\n"
" )\n"
" (else\n"
" (cond\n"
" ((or (= v1-1 (quote int128)) (= v1-1 (quote uint128)))\n"
" (dotimes (s5-8 (-> arg0 length))\n"
" (format\n"
" #t\n"
" \"~T [~D] #x~X~%\"\n"
" s5-8\n"
" (-> (the-as (array uint128) arg0) s5-8)\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-9 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-9 (-> (the-as (array int32) arg0) s5-9))\n"
" )\n"
" )\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-9 (-> arg0 length))\n"
" (format #t \"~T [~D] ~D~%\" s5-9 (-> (the-as (array int32) arg0) s5-9))\n"
" )\n"
" )\n"
" )\n"
" )\n"
" ((= (-> arg0 content-type) float)\n"
" (dotimes (s5-10 (-> arg0 length))\n"
" (format #t \"~T [~D] ~f~%\" s5-10 (-> (the-as (array float) arg0) s5-10))\n"
" )\n"
" )\n"
" (else\n"
" (cond\n"
" ((= (-> arg0 content-type) float)\n"
" (dotimes (s5-10 (-> arg0 length))\n"
" (format #t \"~T [~D] ~f~%\" s5-10 (-> (the-as (array float) arg0) s5-10))\n"
" )\n"
" )\n"
" (else\n"
" (dotimes (s5-11 (-> arg0 length))\n"
" (format #t \"~T [~D] ~A~%\" s5-11 (-> (the-as (array basic) arg0) s5-11))\n"
" )\n"
" )\n"
" (dotimes (s5-11 (-> arg0 length))\n"
" (format #t \"~T [~D] ~A~%\" s5-11 (-> (the-as (array basic) arg0) s5-11))\n"
" )\n"
" )\n"
" )\n"
@@ -1811,8 +1786,7 @@ TEST_F(FormRegressionTest, ExprValid) {
" ((not arg1)\n"
" (cond\n"
" ((nonzero? (logand (the-as int arg0) 3))\n"
" (if\n"
" arg2\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object (misaligned)~%\"\n"
@@ -1823,8 +1797,7 @@ TEST_F(FormRegressionTest, ExprValid) {
" #f\n"
" )\n"
" ((not v1-1)\n"
" (if\n"
" arg2\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object (bad address)~%\"\n"
@@ -1834,101 +1807,55 @@ TEST_F(FormRegressionTest, ExprValid) {
" )\n"
" #f\n"
" )\n"
" (else #t)\n"
" (else\n"
" #t\n"
" )\n"
" )\n"
" )\n"
" ((and arg3 (not arg0)) #t)\n"
" (else\n"
" ((and arg3 (not arg0))\n"
" #t\n"
" )\n"
" ((= arg1 structure)\n"
" (cond\n"
" ((= arg1 structure)\n"
" (cond\n"
" ((nonzero? (logand (the-as int arg0) 15))\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((or\n"
" (not v1-1)\n"
" (begin\n"
" (let ((v1-10 #x8000)) (.daddu v1-11 v1-10 s7-0))\n"
" (< (the-as uint arg0) (the-as uint v1-11))\n"
" )\n"
" )\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else #t)\n"
" )\n"
" )\n"
" ((= arg1 pair)\n"
" (cond\n"
" ((!= (logand (the-as int arg0) 7) 2)\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((not v1-1)\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else #t)\n"
" )\n"
" )\n"
" ((= arg1 binteger)\n"
" (cond\n"
" ((zero? (logand (the-as int arg0) 7)) #t)\n"
" (else\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" ((nonzero? (logand (the-as int arg0) 15))\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((!= (logand (the-as int arg0) 7) 4)\n"
" (if\n"
" arg2\n"
" ((or (not v1-1) (begin\n"
" (let ((v1-10 #x8000))\n"
" (.daddu v1-11 v1-10 s7-0)\n"
" )\n"
" (< (the-as uint arg0) (the-as uint v1-11))\n"
" )\n"
" )\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else\n"
" #t\n"
" )\n"
" )\n"
" )\n"
" ((= arg1 pair)\n"
" (cond\n"
" ((!= (logand (the-as int arg0) 7) 2)\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
@@ -1940,8 +1867,7 @@ TEST_F(FormRegressionTest, ExprValid) {
" #f\n"
" )\n"
" ((not v1-1)\n"
" (if\n"
" arg2\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%\"\n"
@@ -1952,94 +1878,137 @@ TEST_F(FormRegressionTest, ExprValid) {
" )\n"
" #f\n"
" )\n"
" ((and (= arg1 type) (!= (rtype-of arg0) type))\n"
" (if\n"
" arg2\n"
" (else\n"
" #t\n"
" )\n"
" )\n"
" )\n"
" ((= arg1 binteger)\n"
" (cond\n"
" ((zero? (logand (the-as int arg0) 7))\n"
" #t\n"
" )\n"
" (else\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%\"\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" )\n"
" )\n"
" ((!= (logand (the-as int arg0) 7) 4)\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((not v1-1)\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((and (= arg1 type) (!= (rtype-of arg0) type))\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((and (!= arg1 type) (not (valid? (rtype-of arg0) type #f #t 0)))\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((not (type-type? (rtype-of arg0) arg1))\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (is type '~A' "
"instead)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((= arg1 symbol)\n"
" (let ((v1-43 #x8000))\n"
" (.daddu v1-44 v1-43 s7-0)\n"
" )\n"
" (cond\n"
" ((>= (the-as uint arg0) (the-as uint v1-44))\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (not in symbol "
"table)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else\n"
" (cond\n"
" ((and (!= arg1 type) (not (valid? (rtype-of arg0) type #f #t 0)))\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type "
"#x~X)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((not (type-type? (rtype-of arg0) arg1))\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (is type '~A' "
"instead)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" (rtype-of arg0)\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" ((= arg1 symbol)\n"
" (let ((v1-43 #x8000)) (.daddu v1-44 v1-43 s7-0))\n"
" (cond\n"
" ((>= (the-as uint arg0) (the-as uint v1-44))\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (not in symbol "
"table)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else #t)\n"
" )\n"
" )\n"
" ((begin\n"
" (let ((v1-47 #x8000)) (.daddu v1-48 v1-47 s7-0))\n"
" (< (the-as uint arg0) (the-as uint v1-48))\n"
" )\n"
" (if\n"
" arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (inside symbol "
"table)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else #t)\n"
" )\n"
" #t\n"
" )\n"
" )\n"
" )\n"
" ((begin\n"
" (let ((v1-47 #x8000))\n"
" (.daddu v1-48 v1-47 s7-0)\n"
" )\n"
" (< (the-as uint arg0) (the-as uint v1-48))\n"
" )\n"
" (if arg2\n"
" (format\n"
" arg4\n"
" \"ERROR: object #x~X ~S is not a valid object of type '~A' (inside symbol table)~%\"\n"
" arg0\n"
" arg2\n"
" arg1\n"
" )\n"
" )\n"
" #f\n"
" )\n"
" (else\n"
" #t\n"
" )\n"
" )\n"
" )";
test_with_expr(
@@ -2377,20 +2346,19 @@ TEST_F(FormRegressionTest, ExprStringToInt) {
" (the-as int (+ (+ (-> a0-3 0) -55) (the-as uint (* v0-0 16))))\n"
" )\n"
" )\n"
" ((and\n"
" (>= (-> a0-3 0) (the-as uint 97))\n"
" (>= (the-as uint 102) (-> a0-3 0))\n"
" )\n"
" (set!\n"
" v0-0\n"
" (the-as int (+ (+ (-> a0-3 0) -87) (the-as uint (* v0-0 16))))\n"
" )\n"
" )\n"
" (else\n"
" (if\n"
" (and\n"
" (>= (-> a0-3 0) (the-as uint 97))\n"
" (>= (the-as uint 102) (-> a0-3 0))\n"
" )\n"
" (set!\n"
" v0-0\n"
" (the-as int (+ (+ (-> a0-3 0) -87) (the-as uint (* v0-0 16))))\n"
" )\n"
" (set!\n"
" v0-0\n"
" (the-as int (+ (+ (-> a0-3 0) -48) (the-as uint (* v0-0 16))))\n"
" )\n"
" (set!\n"
" v0-0\n"
" (the-as int (+ (+ (-> a0-3 0) -48) (the-as uint (* v0-0 16))))\n"
" )\n"
" )\n"
" )\n"
@@ -2844,16 +2812,14 @@ TEST_F(FormRegressionTest, Method19ResTag) {
" )\n"
" (cond\n"
" ((zero? t6-5)\n"
" (begin\n"
" (set! t4-1 t5-2)\n"
" (goto cfg-32)\n"
" )\n"
" (set! t4-1 t5-2)\n"
" (goto cfg-32)\n"
" )\n"
" ((< (the-as int t6-5) 0)\n"
" (set! t3-1 (+ t5-2 -1))\n"
" )\n"
" (else\n"
" (if (< (the-as int t6-5) 0)\n"
" (set! t3-1 (+ t5-2 -1))\n"
" (set! t4-0 (+ t5-2 1))\n"
" )\n"
" (set! t4-0 (+ t5-2 1))\n"
" )\n"
" )\n"
" )\n"
@@ -2880,12 +2846,10 @@ TEST_F(FormRegressionTest, Method19ResTag) {
" )\n"
" (+! t4-1 -1)\n"
" )\n"
" (if (= arg2 'base)\n"
" (begin\n"
" (set! t0-6 t4-1)\n"
" (set! v1-14 t4-1)\n"
" (goto cfg-73)\n"
" )\n"
" (when (= arg2 'base)\n"
" (set! t0-6 t4-1)\n"
" (set! v1-14 t4-1)\n"
" (goto cfg-73)\n"
" )\n"
" (let ((t3-13 t4-1)\n"
" (t4-4 (&-> (-> arg0 tag) t4-1))\n"
@@ -2907,11 +2871,9 @@ TEST_F(FormRegressionTest, Method19ResTag) {
" ((!= arg1 (-> t4-4 0 name))\n"
" )\n"
" ((= (-> t4-4 0 key-frame) arg3)\n"
" (begin\n"
" (set! t0-6 t3-13)\n"
" (set! v1-14 t3-13)\n"
" (goto cfg-73)\n"
" )\n"
" (set! t0-6 t3-13)\n"
" (set! v1-14 t3-13)\n"
" (goto cfg-73)\n"
" )\n"
" ((and (>= arg3 (-> t4-4 0 key-frame)) (!= arg2 'exact))\n"
" (set! t0-6 t3-13)\n"
@@ -2921,12 +2883,10 @@ TEST_F(FormRegressionTest, Method19ResTag) {
" )\n"
" )\n"
" ((< arg3 (-> t4-4 0 key-frame))\n"
" (begin\n"
" (if (and (!= t0-6 t1-0) (= arg2 'interp))\n"
" (set! v1-14 t3-13)\n"
" )\n"
" (goto cfg-73)\n"
" (if (and (!= t0-6 t1-0) (= arg2 'interp))\n"
" (set! v1-14 t3-13)\n"
" )\n"
" (goto cfg-73)\n"
" )\n"
" )\n"
" (+! t3-13 1)\n"