├── src ├── obj │ └── dummy ├── common.bi └── util.bi ├── tests ├── removevar.bi ├── cpp │ ├── empty-file.bi │ ├── empty-file.h │ ├── include │ │ ├── empty.bi │ │ ├── empty-multiple.bi │ │ ├── empty-1.h │ │ ├── empty-multiple-1.h │ │ ├── empty-multiple-2.h │ │ ├── empty-multiple-3.h │ │ ├── empty.h │ │ ├── include-with-escape.h │ │ ├── simple-1.h │ │ ├── include-missing-filename.h │ │ ├── nested-1-1.h │ │ ├── include-missing-eol.bi │ │ ├── include-missing-eol.h │ │ ├── include_next │ │ │ ├── b │ │ │ │ └── 1.h │ │ │ ├── a │ │ │ │ └── 1.h │ │ │ ├── main.h │ │ │ └── main.bi │ │ ├── nested.h │ │ ├── notfound.h │ │ ├── simple-multiple-1.h │ │ ├── simple-multiple-2.h │ │ ├── simple-multiple-3.h │ │ ├── system-include │ │ │ ├── common.h │ │ │ ├── sys │ │ │ │ ├── common.h │ │ │ │ └── sysonly.h │ │ │ ├── main.h │ │ │ └── main.bi │ │ ├── include-with-escape.bi │ │ ├── nested-1.h │ │ ├── simple.h │ │ ├── notfound.bi │ │ ├── filename-from-macro.h │ │ ├── empty-multiple.h │ │ ├── filename-from-macro.bi │ │ ├── nested.bi │ │ ├── simple.bi │ │ ├── simple-multiple.h │ │ ├── angle-brackets-no-macro-expansion.bi │ │ ├── include-missing-filename.txt │ │ ├── include-missing-eol-1.h │ │ └── simple-multiple.bi │ ├── no-eol-at-eof.bi │ ├── assuming-undefined.bi │ ├── pragma-once-main.bi │ ├── if │ │ ├── endif-missing.h │ │ ├── endif-missing-2.h │ │ ├── endif-without-if.h │ │ ├── elif-without-if.h │ │ ├── else-without-if.h │ │ ├── if-missing-condition.h │ │ ├── ifdef-missing-id.h │ │ ├── ifndef-missing-id.h │ │ ├── duplicate-else.h │ │ ├── endif-missing-in-include.h │ │ ├── elif-after-else.h │ │ ├── elif-missing-condition.h │ │ ├── eval-expr.bi │ │ ├── elseif.h │ │ ├── endif-missing-in-include-2.h │ │ ├── elseif.txt │ │ ├── float.h │ │ ├── endif-missing.txt │ │ ├── duplicate-else.txt │ │ ├── else-without-if.txt │ │ ├── endif-missing-2.txt │ │ ├── elif-after-else.txt │ │ ├── elif-without-if.txt │ │ ├── endif-missing-in-include.txt │ │ ├── endif-without-if.txt │ │ ├── float.txt │ │ ├── endif-missing-in-include-2.txt │ │ ├── if-missing-condition.txt │ │ ├── elif-missing-condition.txt │ │ ├── nesting-limit.txt │ │ ├── ifdef-missing-id.txt │ │ └── ifndef-missing-id.txt │ ├── unknown-directive.h │ ├── define-missing-id.h │ ├── push-pop-macro │ │ ├── push-undefined-does-not-define.bi │ │ ├── pop-without-push-does-not-define.bi │ │ ├── pop-undefines.bi │ │ ├── stack-excessive.bi │ │ ├── push-does-not-undefine.bi │ │ ├── pop-without-matching-push-does-not-define.bi │ │ ├── pop-without-push-does-not-define.h │ │ ├── push-undefined-does-not-define.h │ │ ├── push-does-not-undefine.h │ │ ├── push-empty.bi │ │ ├── push-nonempty.bi │ │ ├── push-empty.h │ │ ├── push-nonempty.h │ │ ├── pop-restores-body-2.bi │ │ ├── pop-restores-body-3.bi │ │ ├── pop-restores-params-1.bi │ │ ├── pop-restores-params-2.bi │ │ ├── pop-restores-params-3.bi │ │ ├── pop-restores-body-1.bi │ │ ├── simple.bi │ │ ├── pop-undefines.h │ │ ├── simple.h │ │ ├── pop-without-matching-push-does-not-define.h │ │ └── pop-restores-body-2.h │ ├── unknown-pragma.h │ ├── div-by-zero-1.h │ ├── div-by-zero-2.h │ ├── error-directive.h │ ├── define-missing-param-id-1.h │ ├── define-missing-param-id-2.h │ ├── defined-as-macro-id.h │ ├── expand │ │ ├── vaargs-as-normal-id-1.h │ │ ├── call-args-expect0-given1.h │ │ ├── call-args-expect0-given2.h │ │ ├── call-args-expect1-given1empty.bi │ │ ├── call-args-expect1-given2.h │ │ ├── call-args-expect2-given1.h │ │ ├── recursion-objectlike.bi │ │ ├── vaargs-as-normal-id-2.h │ │ ├── call-args-expect2-given1empty.h │ │ ├── call-args-expect2-given3.h │ │ ├── call-args-expect2va-given0.h │ │ ├── call-args-expect2va-given1.h │ │ ├── directive-from-expansion.bi │ │ ├── recursion-after-pasting.bi │ │ ├── recursion-objectlike.h │ │ ├── undeffed-isnt-expanded-anymore.h │ │ ├── vaargs-as-normal-id-3.h │ │ ├── merge │ │ │ ├── id-string-2.h │ │ │ ├── missing-lhs.h │ │ │ ├── missing-rhs.h │ │ │ ├── string-id-2.h │ │ │ ├── strings-2.h │ │ │ ├── id-string-1.h │ │ │ ├── missing-operands-objectlike.h │ │ │ ├── string-id-1.h │ │ │ ├── strings-1.h │ │ │ ├── missing-operands-functionlike.h │ │ │ ├── nonhexdigits.bi │ │ │ ├── nonoctdigits.bi │ │ │ ├── nonoctdigits.h │ │ │ ├── from-macro-arg.bi │ │ │ ├── nonhexdigits.h │ │ │ ├── merge-with-merge-token.h │ │ │ ├── from-macro-arg.h │ │ │ ├── id-string-2.txt │ │ │ ├── string-id-2.txt │ │ │ ├── strings-2.txt │ │ │ ├── id-string-1.txt │ │ │ ├── merge-with-merge-token.txt │ │ │ ├── string-id-1.txt │ │ │ ├── strings-1.txt │ │ │ ├── missing-rhs.txt │ │ │ └── missing-lhs.txt │ │ ├── call-args-expect1va-given1empty.bi │ │ ├── call-self-in-arg.bi │ │ ├── params-zero.h │ │ ├── call-args-expect1-given1empty.h │ │ ├── params-zero.bi │ │ ├── call-zeroargs-missing-parentheses.bi │ │ ├── incomplete-call-1.bi │ │ ├── recursion-functionlike.h │ │ ├── incomplete-self-call-in-arg.bi │ │ ├── vaargs-as-normal-id-1.bi │ │ ├── call-other-in-arg.bi │ │ ├── incomplete-recursion-2.bi │ │ ├── recursion-functionlike.bi │ │ ├── call-args-expect1va-given1empty.h │ │ ├── call-other-in-expansion.bi │ │ ├── recursion-after-pasting.h │ │ ├── call-zeroargs-missing-parentheses.h │ │ ├── incomplete-recursion-1.h │ │ ├── indirect-recursion-objectlike.bi │ │ ├── incomplete-call-2.bi │ │ ├── incomplete-call-other-in-expansion.h │ │ ├── params-none.bi │ │ ├── undeffed-isnt-expanded-anymore.bi │ │ ├── vaargs-as-normal-id-3.bi │ │ ├── expansion-after-pasting.bi │ │ ├── indirect-recursion-objectlike.h │ │ ├── stringify-first-then-merge.h │ │ ├── vaargs-as-normal-id-2.bi │ │ ├── directive-from-expansion.h │ │ ├── call-self-in-arg.h │ │ ├── incomplete-recursion-1.bi │ │ ├── no-expansion-before-pasting.bi │ │ ├── incomplete-call-other-in-expansion.bi │ │ ├── incomplete-call-other-in-arg.h │ │ ├── call-other-in-expansion.h │ │ ├── expansion-after-pasting.h │ │ ├── incomplete-call-other-in-arg.bi │ │ ├── call-args-expect0-given1.txt │ │ ├── call-args-expect2-given1.txt │ │ ├── call-args-expect2va-given0.txt │ │ ├── call-other-in-arg.h │ │ ├── call-args-expect0-given2.txt │ │ ├── call-args-expect1-given2.txt │ │ ├── call-args-expect2-given1empty.txt │ │ ├── call-args-expect2va-given1.txt │ │ ├── indirect-recursion-functionlike.bi │ │ ├── stringify-first-then-merge.bi │ │ ├── unmerged-tokens-in-merged-arg-still-expanded.bi │ │ ├── incomplete-recursion-2.h │ │ ├── call-args-expect2-given3.txt │ │ ├── dont-expand-arg-too-early.txt │ │ ├── indirect-recursion-functionlike.h │ │ ├── incomplete-call-1.h │ │ └── incomplete-call-2.h │ ├── no-eol-at-eof.h │ ├── directives-1.h │ ├── div-by-zero-3.h │ ├── define-conflicting-duplicate.bi │ ├── pragma-once-1.h │ ├── define-conflicting-duplicate.h │ ├── guard │ │ ├── a.h │ │ ├── recursive-b.h │ │ ├── recursive-a.bi │ │ ├── b.h │ │ ├── c.h │ │ ├── d.h │ │ ├── f.h │ │ ├── e.h │ │ └── g.h │ ├── div-by-zero-1.txt │ ├── div-by-zero-2.txt │ ├── error-directive.txt │ ├── unknown-directive.txt │ ├── unknown-pragma-2.txt │ ├── unknown-pragma.txt │ ├── unknown-pragma-2.h │ ├── div-by-zero-3.txt │ ├── define-missing-id.txt │ ├── defined-as-macro-id.txt │ ├── skipping-invalid-directives.bi │ ├── unexpanded-if-cond.txt │ ├── dividers-inside-statements.h │ ├── define-missing-param-id-1.txt │ ├── define-missing-param-id-2.txt │ └── dividers-inside-statements.bi ├── fbfroginclude.bi ├── removeproc.bi ├── versions │ ├── max1.bi │ ├── builtin.bi │ ├── builtin.h │ ├── target-dos.bi │ ├── empty-if-block.bi │ ├── includes │ │ ├── main.bi │ │ ├── 1.h │ │ ├── 2.h │ │ └── main.h │ ├── nested-in-case1.bi │ ├── nested-in-case2.bi │ ├── target-noarm.bi │ ├── target-nodos.bi │ ├── target-windows.bi │ ├── various-nesting.bi │ ├── empty-else-block.bi │ ├── empty-elseif-block.bi │ ├── nested-in-caseelse.bi │ ├── nested-in-ifdef-true.bi │ ├── nested-in-ifdef-false.bi │ ├── nested-in-unreached-if-block.bi │ ├── target-dos.h │ ├── target-noarm.h │ ├── target-nodos.h │ ├── target-windows.h │ ├── various-nesting.h │ ├── max2.txt │ ├── nested-in-ifdef-true.h │ ├── nested-in-case1.h │ ├── nested-in-ifdef-false.h │ ├── nested-in-unreached-if-block.h │ ├── empty-else-block.h │ ├── empty-if-block.h │ ├── nested-in-case2.h │ ├── nested-in-caseelse.h │ ├── iftarget-unix.h │ ├── declarebool.bi │ ├── empty-elseif-block.h │ ├── iftarget-32bit.h │ ├── iftarget-64bit.h │ ├── max1.h │ ├── target-dos.txt │ ├── simplifications.fbfrog │ ├── combine-sibling-ifblocks-2.h │ ├── declarebool.h │ ├── max2.h │ ├── target-windows.txt │ ├── combine-sibling-ifblocks.h │ ├── declareversions.bi │ ├── declareversions.fbfrog │ ├── iftarget-unix.bi │ ├── declareversions.h │ └── swapping-nested.txt ├── c │ ├── pragma-define.bi │ ├── macro-body │ │ ├── macro-body-const.bi │ │ ├── b.h │ │ ├── macro-body-const.h │ │ ├── macro-body-invalid-numlit.h │ │ ├── line-file.h │ │ ├── macro-body-invalid-numlit.bi │ │ ├── macro-body-callconv.bi │ │ ├── ref-unknown-define.bi │ │ ├── line-file.bi │ │ ├── no-recursive-macro.h │ │ ├── nested-directive.bi │ │ ├── macro-body-datatype.h │ │ ├── macro-param-parentheses.h │ │ ├── ref-unknown-define.h │ │ ├── macro-param-parentheses.bi │ │ ├── main-1.bi │ │ ├── no-recursive-macro.bi │ │ ├── macro-body-callconv.h │ │ └── nested-directive.h │ ├── pragma-pack │ │ ├── missing-pop.bi │ │ ├── initially-off.h │ │ ├── missing-push-1.h │ │ ├── missing-push-1.bi │ │ ├── missing-push-2.bi │ │ ├── enabled-and-not-disabled.h │ │ ├── initially-off.bi │ │ ├── disabled-even-though-not-enabled.bi │ │ ├── enabled-and-not-disabled.bi │ │ ├── missing-push-2.h │ │ └── no-nesting.bi │ ├── typedef │ │ ├── typedef-proc-unused.bi │ │ ├── typedef-array-unused.bi │ │ ├── typedef-array-unused.h │ │ ├── typedef-proc-unused.h │ │ ├── typedef-proc-impossible-function-result.h │ │ ├── typedef-multdecl.h │ │ ├── typedef-fixup-1.h │ │ ├── typedef-fixup-3.h │ │ ├── typedef-proc-impossible-function-result.txt │ │ ├── syntax.h │ │ └── typedef-fixup-1.bi │ ├── void-cast.h │ ├── register.h │ ├── typedefs-and-tags │ │ ├── case-alias-forward.bi │ │ ├── exact-alias-forward.bi │ │ ├── useless-struct-decl.bi │ │ ├── useless-tag-decl.bi │ │ ├── useless-union-decl.bi │ │ ├── useless-struct-decl.h │ │ ├── useless-union-decl.h │ │ ├── case-alias-forward.h │ │ ├── double-alias.bi │ │ ├── exact-alias-1.bi │ │ ├── different-id-alias-forward.bi │ │ ├── exact-alias-forward-solved.bi │ │ ├── tagid-first-used-in-typedef.h │ │ ├── double-alias.h │ │ ├── case-alias-for-struct-1.bi │ │ ├── case-alias-for-struct-2.bi │ │ ├── different-id-alias-1.bi │ │ ├── exact-alias-forward.h │ │ ├── case-alias-for-struct-1.h │ │ ├── case-alias-for-struct-2.h │ │ ├── different-id-alias-forward.h │ │ ├── case-alias-array.h │ │ ├── exact-alias-array.h │ │ ├── case-alias-const.h │ │ ├── different-id-alias-forward-solved.bi │ │ ├── exact-alias-const.h │ │ ├── conflict-enum.h │ │ ├── no-conflict-enum.h │ │ ├── tagid-first-used-in-typedef.bi │ │ ├── case-alias-forward-used.bi │ │ ├── conflict-union.h │ │ ├── conflict-struct.h │ │ ├── exact-alias-forward-used.bi │ │ ├── implicit-forward-unsolved.bi │ │ ├── no-conflict-struct.h │ │ ├── no-conflict-union.h │ │ ├── exact-alias-1.h │ │ ├── different-id-alias-forward-used.bi │ │ ├── exact-alias-forward-solved.h │ │ ├── implicit-forward-unsolved.h │ │ ├── case-alias-array.bi │ │ ├── exact-alias-array.bi │ │ ├── useless-tag-decl.h │ │ ├── case-alias-forward-used-2.bi │ │ ├── conflict-struct.bi │ │ ├── conflict-union.bi │ │ ├── different-id-alias-1.h │ │ ├── renametag-enum.h │ │ ├── no-conflict-struct.bi │ │ ├── no-conflict-union.bi │ │ ├── case-alias-const.bi │ │ ├── case-alias-forward-used.h │ │ ├── conflict-enum.bi │ │ ├── exact-alias-const.bi │ │ ├── exact-alias-forward-used.h │ │ ├── implicit-forward-solved-2.bi │ │ ├── no-conflict-enum.bi │ │ ├── renametag-struct.h │ │ ├── renametag-union.h │ │ ├── renametypedef-enum.h │ │ ├── different-id-alias-forward-solved.h │ │ ├── different-id-alias-forward-used.h │ │ ├── renametypedef-union.h │ │ ├── exact-alias-forward-solved-used.bi │ │ ├── implicit-forward-solved-1.bi │ │ ├── renametypedef-struct.h │ │ ├── case-alias-forward-used-solved.bi │ │ ├── exact-alias-2.bi │ │ ├── exact-alias-3.bi │ │ ├── different-id-alias-forward-used-2.bi │ │ ├── exact-alias-forward-used-solved.bi │ │ ├── different-id-alias-forward-used-solved.bi │ │ ├── implicit-forward-solved-1.h │ │ ├── different-id-alias-2.bi │ │ ├── different-id-alias-3.bi │ │ ├── different-id-alias-forward-solved-used.bi │ │ ├── case-alias-forward-used-solved-2.bi │ │ ├── case-alias-forward-used-2.h │ │ └── case-alias-forward-used-solved-used.bi │ ├── id-basetype-missing-id.h │ ├── missing-semicolon.h │ ├── array-plus-alias.h │ ├── param-missing-dtypes.h │ ├── proc-param-list-open.h │ ├── void-cast.bi │ ├── keyword-basetype-missing-id.h │ ├── proc-missing-semicolon.h │ ├── special-identifiers.h │ ├── unexpanded.bi │ ├── array-size-unknown.h │ ├── basetype │ │ ├── long-char.h │ │ ├── long-void.h │ │ ├── short-char.h │ │ ├── short-void.h │ │ ├── long-struct.h │ │ ├── signed-void.h │ │ ├── short-struct.h │ │ ├── signed-struct.h │ │ ├── unsigned-void.h │ │ ├── double-long-long.h │ │ ├── long-char.bi │ │ ├── long-long-double.h │ │ ├── long-signed-char.h │ │ ├── long-void.bi │ │ ├── short-char.bi │ │ ├── short-signed-char.h │ │ ├── short-void.bi │ │ ├── unsigned-struct.h │ │ ├── long-struct.bi │ │ ├── long-unsigned-char.h │ │ ├── short-unsigned-char.h │ │ ├── signed-void.bi │ │ ├── unsigned-void.bi │ │ ├── double-long-long.bi │ │ ├── long-long-double.bi │ │ ├── short-struct.bi │ │ ├── signed-struct.bi │ │ ├── long-inttypedef.h │ │ ├── long-signed-char.bi │ │ ├── long-unsigned-char.bi │ │ ├── short-inttypedef.h │ │ ├── short-signed-char.bi │ │ ├── unsigned-struct.bi │ │ ├── short-unsigned-char.bi │ │ ├── signed-inttypedef.h │ │ ├── unsigned-inttypedef.h │ │ ├── long-inttypedef.bi │ │ ├── short-inttypedef.bi │ │ ├── signed-inttypedef.bi │ │ └── unsigned-inttypedef.bi │ ├── bitfield-not-supported-here.h │ ├── id-basetype-missing-id-and-semicolon.h │ ├── id-basetype-missing-id.bi │ ├── missing-semicolon.bi │ ├── param-missing-initexpr.h │ ├── param-unexpected-token.h │ ├── proc-void-param-list-open.h │ ├── keyword-basetype-missing-id-and-semicolon.h │ ├── keyword-basetype-missing-id.bi │ ├── mixed.h │ ├── param-missing-dtypes.bi │ ├── proc-param-list-open.bi │ ├── code-as-seen-by-fbfrog.bi │ ├── proc-missing-semicolon.bi │ ├── proc-void-param-list-open.bi │ ├── bitfield-not-supported-here.bi │ ├── id-basetype-missing-id-and-semicolon.bi │ ├── param-missing-initexpr.bi │ ├── param-unexpected-token.bi │ ├── function-body-not-on-first-declarator.h │ ├── function-body-not-on-last-declarator.h │ ├── keyword-basetype-missing-id-and-semicolon.bi │ ├── struct │ │ ├── nested-named-enum.h │ │ ├── union-in-union-1.h │ │ ├── struct-in-struct-1.h │ │ ├── typedef-union.h │ │ ├── typedef-with-nesting.h │ │ ├── nested-named-enum-as-named-field.h │ │ ├── nested-unnamed-union-as-named-field.h │ │ ├── nested-unnamed-union-as-unnamed-field.h │ │ ├── nested-named-struct-as-named-field.h │ │ ├── nested-named-union-as-named-field.h │ │ ├── nested-unnamed-struct-as-named-field.h │ │ ├── struct-in-struct-3.h │ │ ├── union-in-union-2.h │ │ ├── union-in-union-3.h │ │ ├── struct-in-struct-2.h │ │ ├── nested-named-struct-2.h │ │ ├── nested-named-union.bi │ │ ├── nested-unnamed-struct-as-named-field-2.h │ │ ├── nested-unnamed-union-as-unnamed-field.bi │ │ ├── nested-named-enum.bi │ │ ├── union-in-union-4.h │ │ ├── struct-in-struct-4.h │ │ ├── toplevel.h │ │ ├── struct-in-struct-1.bi │ │ ├── union-in-union-1.bi │ │ ├── nested-named-struct-2.bi │ │ ├── nested-named-struct-as-named-field.bi │ │ ├── nested-named-enum-as-named-field.bi │ │ ├── nested-named-union-as-named-field.bi │ │ ├── nested-unnamed-struct-as-named-field.bi │ │ ├── nested-unnamed-union-as-named-field-2.h │ │ ├── nested-unnamed-union-as-named-field.bi │ │ ├── struct-body-in-declaration.h │ │ ├── typedef-union.bi │ │ ├── union-in-union-5.h │ │ ├── nested-named-struct-isnt-scoped.bi │ │ ├── struct-in-struct-5.h │ │ ├── nested-unnamed-struct-as-named-field-3.h │ │ ├── nested-named-struct-isnt-scoped.h │ │ ├── struct-in-struct-3.bi │ │ ├── union-in-union-3.bi │ │ ├── struct-body-followed-by-field-declarators.h │ │ ├── nested-named-union.h │ │ ├── nested-unnamed-struct-as-named-field-2.bi │ │ ├── typedef-with-nesting.bi │ │ ├── toplevel.bi │ │ ├── typedef-struct.h │ │ ├── nested-named-struct.bi │ │ ├── nested-unnamed-struct-as-unnamed-field.h │ │ ├── struct-in-struct-2.bi │ │ ├── struct-in-struct-4.bi │ │ ├── union-in-union-2.bi │ │ ├── union-in-union-4.bi │ │ └── nested-unnamed-union-as-named-field-2.bi │ ├── too-many-pointers │ │ ├── highlevel-2.h │ │ ├── highlevel-2.txt │ │ ├── highlevel-3.h │ │ ├── highlevel-3.txt │ │ ├── highlevel-1.h │ │ └── highlevel-1.txt │ ├── extern-block.h │ ├── macro-preferred.h │ ├── function-body-not-on-first-declarator.bi │ ├── id-basetype-missing-id-in-macro.h │ ├── special-identifiers.bi │ ├── decl-basetype-pasted-missing-id.h │ ├── register.bi │ ├── id-basetype-missing-id-and-semicolon-in-macro.h │ ├── pragma-define.h │ ├── vararg-callconv.bi │ ├── array-plus-alias.bi │ ├── dupdef.h │ ├── callconv-plus-alias.h │ ├── pragma-comment-lib.bi │ ├── array-size-unknown.bi │ ├── code-as-seen-by-fbfrog.h │ ├── extern-block.bi │ ├── vararg-callconv.h │ ├── callconv-plus-alias.bi │ ├── forward-referenced-typedef.bi │ ├── statement-expression.bi │ ├── unexpanded.h │ ├── function-body-not-on-last-declarator.bi │ ├── mixed-pp-and-decls.bi │ ├── mixed-pp-and-decls.h │ ├── macro-preferred.bi │ ├── statement-expression.h │ ├── asm-alias.h │ ├── decl-basetype-pasted-missing-id.bi │ ├── dupdef.bi │ ├── forward-referenced-typedef.h │ ├── id-basetype-missing-id-in-macro.bi │ ├── id-basetype-missing-id-and-semicolon-in-macro.bi │ └── mixed.bi ├── cli │ ├── comment-at-eof.bi │ ├── empty-arg-1.bi │ ├── empty-arg-2.bi │ ├── declareversions-order-good.bi │ ├── empty-arg-1.h │ ├── empty-arg-2.h │ ├── unknown-option.h │ ├── missing-endif.h │ ├── endif-without-ifdef.h │ ├── ifdef-non-id.h │ ├── comment-at-eof.fbfrog │ ├── comment-at-eof.h │ ├── else-without-ifdef.h │ ├── endselect-without-select.h │ ├── case-without-select.h │ ├── missing-endselect.h │ ├── caseelse-without-select.h │ ├── else-behind-else.h │ ├── case-missing-define.h │ ├── declareversions-bad-order.h │ ├── declareversions-order-good.h │ ├── endif-instead-of-endselect.h │ ├── endselect-instead-of-else-or-endif.h │ ├── endselect-instead-of-endif.h │ ├── unknown-option.txt │ ├── case-behind-caseelse.h │ ├── multiple-declaredefines.h │ ├── unknown-option-behind-declaredefines.h │ ├── multiple-declareversions.h │ ├── no-case-behind-select.h │ ├── multiple-declaredefines.txt │ ├── multiple-declareversions.txt │ ├── caseelse-behind-caseelse.h │ ├── case-missing-version-number.h │ ├── select-unknown-version-number.h │ ├── unknown-option-behind-declaredefines.txt │ ├── selecttarget.h │ ├── title.h │ ├── removedefine-missing-arg.h │ ├── select-unknown-version-number.txt │ ├── missing-endif.txt │ ├── else-without-ifdef.txt │ ├── endif-without-ifdef.txt │ ├── case-without-select.txt │ ├── selecttarget.bi │ ├── title-bispecific.h │ ├── title.txt │ ├── else-behind-else.txt │ ├── endselect-without-select.txt │ ├── ifdef-non-id.txt │ ├── missing-endselect.txt │ ├── title-bispecific.txt │ ├── caseelse-without-select.txt │ ├── caseelse-behind-caseelse.txt │ ├── no-case-behind-select.txt │ └── removedefine-missing-arg.txt ├── lex │ ├── comment-only.bi │ ├── comment-only.h │ ├── open-char-literal.h │ ├── open-include-literal.h │ ├── open-multiline-comment.h │ ├── open-string-literal.h │ ├── token-text-is-not-a-keyword.h │ ├── token-text-is-not-a-keyword.bi │ ├── stray-byte.bi │ ├── stray-byte.h │ ├── open-char-literal.txt │ ├── open-multiline-comment.txt │ ├── open-string-literal.txt │ ├── counts-lines-in-line-comment.h │ ├── counts-lines-in-multiline-comment.h │ ├── counts-lines-for-escaped-eols.h │ ├── open-include-literal.txt │ ├── escaped-eol.bi │ └── numlit-tokens.bi ├── highlevel │ ├── alias-defines-moved │ │ ├── other1.bi │ │ ├── other1.h │ │ ├── other2.h │ │ ├── other2.bi │ │ ├── main.bi │ │ └── main.h │ ├── expand-typedef.h │ ├── forcefunction2macro.h │ ├── expand-typedef.bi │ ├── string-does-nothing.bi │ ├── typedef-defines.h │ ├── self-alias-define.bi │ ├── cast-addrof-strlit.h │ ├── forcefunction2macro.bi │ ├── self-alias-define.h │ └── typedef-expansion-in-define-bodies.h ├── cxx │ └── refs │ │ ├── bad-ref-to-ref.h │ │ ├── bad-const-on-ref.h │ │ ├── bad-pointer-to-ref.h │ │ ├── bad-array-of-refs.h │ │ ├── bad-pointer-to-ref.bi │ │ ├── bad-ref-to-ref.bi │ │ ├── bad-const-on-ref.bi │ │ └── bad-array-of-refs.bi ├── include │ ├── 1.h │ ├── 2.h │ ├── 3.h │ ├── partial │ │ ├── field.h │ │ └── param.h │ ├── removeinclude.bi │ ├── main-nested-only-1.bi │ ├── main-nested-only-2.bi │ ├── main-one-file-only.bi │ ├── include1.h │ ├── include2.h │ ├── main-multiple-files-2.bi │ ├── main-multiple-files-3.bi │ ├── includeinclude1.h │ ├── main-multiple-files-1.bi │ ├── includenotfound.h │ ├── remove-duplicate-includes.bi │ ├── main-multiple-files-include1.bi │ ├── main-multiple-files-includenotfound.bi │ ├── main-dontemit.bi │ ├── main-one-file-only.h │ ├── main-dontemit.h │ ├── removeinclude.h │ ├── main-nested-only.h │ └── main-default.h ├── title │ ├── example1.h │ ├── example2.h │ ├── bispecific-1.h │ ├── example3.h │ ├── simple.h │ └── bispecific.bi ├── typedefhint.bi ├── inclib │ ├── bi-file-specific │ │ ├── 1.h │ │ ├── 2.h │ │ ├── 1.bi │ │ ├── 2.bi │ │ ├── main.bi │ │ └── main.h │ ├── simple.h │ ├── simple.fbfrog │ └── simple.bi ├── removeproc.h ├── rename │ ├── include.bi │ ├── rename_.h │ ├── strlit.bi │ ├── include.h │ ├── proc.h │ ├── rename_.bi │ ├── strlit.h │ ├── with-alias.bi │ ├── quirk-keyword-types.h │ ├── forwarddecl-should-not-appear-in-renamelist.bi │ ├── proc.bi │ └── with-alias.h ├── typedefhint.h ├── undef │ ├── bi-file-specific │ │ ├── 1.h │ │ ├── 2.h │ │ ├── 1.bi │ │ ├── 2.bi │ │ ├── main.bi │ │ └── main.h │ ├── simple.h │ └── simple.bi ├── addinclude │ ├── bi-file-specific │ │ ├── 1.h │ │ ├── 2.h │ │ ├── 1.bi │ │ ├── 2.bi │ │ └── main.bi │ ├── simple.h │ └── simple.bi ├── autoextern │ ├── vars.h │ ├── no-callconv-at-all.h │ ├── vars.bi │ ├── no-callconv-at-all.bi │ └── cdecl-dominates.h ├── remove2nd.bi ├── replacements │ ├── 1.replacements │ ├── 2.replacements │ ├── 3.replacements │ ├── 1.bi │ ├── 2.bi │ ├── 3.bi │ ├── 1.h │ ├── 2.h │ ├── 3.h │ ├── 4.h │ ├── 5.h │ └── 5.bi ├── undefbeforedecl.bi ├── clong32.h ├── merging │ ├── struct-align.bi │ ├── dllimport.bi │ ├── typedefs.h │ ├── linkage.bi │ ├── struct-align.h │ ├── dllimport.h │ ├── callconv.bi │ ├── simple.bi │ ├── versions.fbfrog │ ├── simple.h │ └── callconv-3.txt ├── typedefhint-2.bi ├── preinclude-1.h ├── typedefhint-2.h ├── moveabove.h ├── preinclude-main.h ├── addforwarddecl.h ├── undefbeforedecl.h ├── clong32.bi ├── removevar.h ├── fbfroginclude.h ├── constants-in-nested-blocks.h ├── moveabove.bi ├── remove1st.bi ├── addforwarddecl.bi ├── remove2nd.h ├── remove1st.h ├── nofunctionbodies.bi ├── preinclude-main.bi ├── remove.bi ├── constants-in-nested-blocks.bi ├── dropmacrobodyscopes.bi ├── dropprocbody.h ├── remove.h ├── nofunctionbodies.h ├── dropprocbody.bi └── nested-unknowns.h ├── include └── fbfrog │ └── stdbool.h └── .gitignore /src/obj/dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/removevar.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/empty-file.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/empty-file.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/fbfroginclude.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/removeproc.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/max1.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/pragma-define.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cli/comment-at-eof.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cli/empty-arg-1.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cli/empty-arg-2.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/include/empty.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/no-eol-at-eof.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/lex/comment-only.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/builtin.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/builtin.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/target-dos.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/assuming-undefined.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/pragma-once-main.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/lex/comment-only.h: -------------------------------------------------------------------------------- 1 | //hello -------------------------------------------------------------------------------- /tests/versions/empty-if-block.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/includes/main.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/nested-in-case1.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/nested-in-case2.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/target-noarm.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/target-nodos.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/target-windows.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/various-nesting.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-const.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/missing-pop.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-proc-unused.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-multiple.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/empty-else-block.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/empty-elseif-block.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/nested-in-caseelse.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/nested-in-ifdef-true.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-array-unused.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/void-cast.h: -------------------------------------------------------------------------------- 1 | #define A (void)f() 2 | -------------------------------------------------------------------------------- /tests/cli/declareversions-order-good.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/versions/includes/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/versions/includes/2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/versions/nested-in-ifdef-false.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/register.h: -------------------------------------------------------------------------------- 1 | void f(register int i); 2 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-struct-decl.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-tag-decl.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-union-decl.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/other1.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/versions/nested-in-unreached-if-block.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cli/empty-arg-1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -define A "" 2 | -------------------------------------------------------------------------------- /tests/cli/empty-arg-2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -define A '' 2 | -------------------------------------------------------------------------------- /tests/cli/unknown-option.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -foo 2 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 1 3 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-multiple-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-multiple-2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-multiple-3.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | -------------------------------------------------------------------------------- /tests/cpp/include/empty.h: -------------------------------------------------------------------------------- 1 | #include "empty-1.h" 2 | -------------------------------------------------------------------------------- /tests/cpp/unknown-directive.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #foo 3 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-ref-to-ref.h: -------------------------------------------------------------------------------- 1 | extern int & &r; 2 | -------------------------------------------------------------------------------- /tests/lex/open-char-literal.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | 'x 3 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | a; 3 | -------------------------------------------------------------------------------- /tests/c/macro-body/b.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | typedef int B; 3 | -------------------------------------------------------------------------------- /tests/c/missing-semicolon.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | int a 3 | -------------------------------------------------------------------------------- /tests/cli/missing-endif.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -ifdef A 2 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-id.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define 3 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | 3 | #if 1 4 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-without-if.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #endif 3 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-undefined-does-not-define.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpp/unknown-pragma.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #pragma foo 3 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-const-on-ref.h: -------------------------------------------------------------------------------- 1 | extern int& const r; 2 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-pointer-to-ref.h: -------------------------------------------------------------------------------- 1 | extern int &*p; 2 | -------------------------------------------------------------------------------- /tests/include/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int i1; 4 | -------------------------------------------------------------------------------- /tests/include/2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int i2; 4 | -------------------------------------------------------------------------------- /tests/include/3.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int i3; 4 | -------------------------------------------------------------------------------- /tests/versions/target-dos.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -target dos 2 | -------------------------------------------------------------------------------- /tests/versions/target-noarm.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -target noarm 2 | -------------------------------------------------------------------------------- /tests/versions/target-nodos.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -target nodos 2 | -------------------------------------------------------------------------------- /tests/c/array-plus-alias.h: -------------------------------------------------------------------------------- 1 | extern int array[10] asm("foo"); 2 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-const.h: -------------------------------------------------------------------------------- 1 | #define MYCONST const 2 | -------------------------------------------------------------------------------- /tests/c/param-missing-dtypes.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void f(,); 3 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/initially-off.h: -------------------------------------------------------------------------------- 1 | struct A { int i; }; 2 | -------------------------------------------------------------------------------- /tests/c/proc-param-list-open.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void f( 3 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-array-unused.h: -------------------------------------------------------------------------------- 1 | typedef int T[10]; 2 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-struct-decl.h: -------------------------------------------------------------------------------- 1 | struct A; 2 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-union-decl.h: -------------------------------------------------------------------------------- 1 | union A; 2 | -------------------------------------------------------------------------------- /tests/c/void-cast.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A f() 4 | -------------------------------------------------------------------------------- /tests/cli/endif-without-ifdef.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -endif 2 | -------------------------------------------------------------------------------- /tests/cli/ifdef-non-id.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -ifdef 123 -endif 2 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 1 / 0 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 1 % 0 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/error-directive.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #error "Something" 3 | -------------------------------------------------------------------------------- /tests/cpp/include/include-with-escape.h: -------------------------------------------------------------------------------- 1 | #include "a\nb" 2 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-without-push-does-not-define.bi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-array-of-refs.h: -------------------------------------------------------------------------------- 1 | extern int &array[10]; 2 | -------------------------------------------------------------------------------- /tests/lex/open-include-literal.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #include comment-at-eof.fbfrog 2 | -------------------------------------------------------------------------------- /tests/cli/else-without-ifdef.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -else -endif 2 | -------------------------------------------------------------------------------- /tests/cli/endselect-without-select.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -endselect 2 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-param-id-1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(,) 3 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-param-id-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a,) 3 | -------------------------------------------------------------------------------- /tests/cpp/defined-as-macro-id.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define defined 3 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-1.h: -------------------------------------------------------------------------------- 1 | void __VA_ARGS__(void); 2 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-without-if.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #elif 0 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/if/else-without-if.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #else 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/if/if-missing-condition.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/if/ifdef-missing-id.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #ifdef 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/if/ifndef-missing-id.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #ifndef 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void simple1(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/no-eol-at-eof.h: -------------------------------------------------------------------------------- 1 | #ifdef FOO 2 | #endif /* no EOL at EOF */ -------------------------------------------------------------------------------- /tests/include/partial/field.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | int myfield; 4 | -------------------------------------------------------------------------------- /tests/include/partial/param.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | int myparam 4 | -------------------------------------------------------------------------------- /tests/title/example1.h: -------------------------------------------------------------------------------- 1 | // @ignore Example © copyright + license text -------------------------------------------------------------------------------- /tests/typedefhint.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define M cast(T, 0) 4 | -------------------------------------------------------------------------------- /tests/c/array-size-unknown.h: -------------------------------------------------------------------------------- 1 | extern int i[]; 2 | extern char s[]; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/long-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/long-void.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long void *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/short-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static short char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/short-void.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static short void *p; 3 | -------------------------------------------------------------------------------- /tests/c/bitfield-not-supported-here.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | int i : 1; 3 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-and-semicolon.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | a 3 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: a; 4 | -------------------------------------------------------------------------------- /tests/c/missing-semicolon.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: int a 4 | -------------------------------------------------------------------------------- /tests/c/param-missing-initexpr.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void f(int i =); 3 | -------------------------------------------------------------------------------- /tests/c/param-unexpected-token.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void f(int i j); 3 | -------------------------------------------------------------------------------- /tests/c/proc-void-param-list-open.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void f(void 3 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward.h: -------------------------------------------------------------------------------- 1 | typedef struct A a; 2 | -------------------------------------------------------------------------------- /tests/cli/case-without-select.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -case a -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/missing-endselect.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -case a 2 | -------------------------------------------------------------------------------- /tests/cpp/directives-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int included; 4 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-3.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 1 / (1 % 1) 3 | #endif 4 | -------------------------------------------------------------------------------- /tests/cpp/include/include-missing-filename.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #include 3 | -------------------------------------------------------------------------------- /tests/cpp/include/nested-1-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void nested3(void); 3 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f1(void); 4 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f2(void); 4 | -------------------------------------------------------------------------------- /tests/removeproc.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removeproc f1 2 | 3 | void f1(void); 4 | -------------------------------------------------------------------------------- /tests/rename/include.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "bar.bi" 4 | -------------------------------------------------------------------------------- /tests/title/example2.h: -------------------------------------------------------------------------------- 1 | // @ignore Example © copyright + license text 2 | -------------------------------------------------------------------------------- /tests/typedefhint.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -typedefhint T 2 | 3 | #define M (T)0 4 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f1(void); 4 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f2(void); 4 | -------------------------------------------------------------------------------- /tests/addinclude/bi-file-specific/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f1(void); 4 | -------------------------------------------------------------------------------- /tests/addinclude/bi-file-specific/2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void f2(void); 4 | -------------------------------------------------------------------------------- /tests/autoextern/vars.h: -------------------------------------------------------------------------------- 1 | int defaultextern; 2 | 3 | extern int externonly; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long struct UDT i; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-void.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static signed void *p; 3 | -------------------------------------------------------------------------------- /tests/c/keyword-basetype-missing-id-and-semicolon.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | int 3 | -------------------------------------------------------------------------------- /tests/c/keyword-basetype-missing-id.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: int; 4 | -------------------------------------------------------------------------------- /tests/c/mixed.h: -------------------------------------------------------------------------------- 1 | extern int a, *(*a)(void), a(void), *a(void), (*a)(void); 2 | -------------------------------------------------------------------------------- /tests/c/param-missing-dtypes.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(,); 4 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/missing-push-1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | #pragma pack(pop) 3 | -------------------------------------------------------------------------------- /tests/c/proc-param-list-open.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f( 4 | -------------------------------------------------------------------------------- /tests/cli/caseelse-without-select.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -caseelse -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/else-behind-else.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -ifdef A -else -else -endif 2 | -------------------------------------------------------------------------------- /tests/cpp/include/include-missing-eol.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 1 4 | -------------------------------------------------------------------------------- /tests/cpp/include/include-missing-eol.h: -------------------------------------------------------------------------------- 1 | #include "include-missing-eol-1.h" 2 | -------------------------------------------------------------------------------- /tests/cpp/include/include_next/b/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | extern int b1; 4 | -------------------------------------------------------------------------------- /tests/cpp/include/nested.h: -------------------------------------------------------------------------------- 1 | void nested1(void); 2 | #include "nested-1.h" 3 | -------------------------------------------------------------------------------- /tests/cpp/include/notfound.h: -------------------------------------------------------------------------------- 1 | #include "header-file-which-does-not-exist.h" 2 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-multiple-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void simple1(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-multiple-2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void simple2(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-multiple-3.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void simple3(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-undefines.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | -------------------------------------------------------------------------------- /tests/inclib/simple.h: -------------------------------------------------------------------------------- 1 | // @fbfrog simple.fbfrog 2 | 3 | void f(void); 4 | -------------------------------------------------------------------------------- /tests/include/removeinclude.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "1.bi" 4 | -------------------------------------------------------------------------------- /tests/remove2nd.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A(x) 1 4 | const B = 1 5 | -------------------------------------------------------------------------------- /tests/title/bispecific-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void bispecific1(void); 4 | -------------------------------------------------------------------------------- /tests/title/example3.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | Example © copyright 3 | license text 4 | -------------------------------------------------------------------------------- /tests/undef/simple.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -undef sleep 2 | 3 | void sleep(void); 4 | -------------------------------------------------------------------------------- /tests/versions/various-nesting.h: -------------------------------------------------------------------------------- 1 | // @fbfrog various-nesting.fbfrog 2 | -------------------------------------------------------------------------------- /tests/c/basetype/short-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static short struct UDT i; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static signed struct UDT i; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-void.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static unsigned void *p; 3 | -------------------------------------------------------------------------------- /tests/c/code-as-seen-by-fbfrog.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(int i; 4 | -------------------------------------------------------------------------------- /tests/c/proc-missing-semicolon.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(void) 4 | -------------------------------------------------------------------------------- /tests/c/proc-void-param-list-open.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(void 4 | -------------------------------------------------------------------------------- /tests/cli/case-missing-define.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -case -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/declareversions-bad-order.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declareversions V 1 3 2 2 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect0-given1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m1() 3 | m1(a) 4 | -------------------------------------------------------------------------------- /tests/cpp/if/duplicate-else.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 0 3 | #else 4 | #else 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-in-include.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #include "endif-missing.h" 3 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/stack-excessive.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 1 4 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/other1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #define A2 A1 4 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/other2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #define A3 A2 4 | -------------------------------------------------------------------------------- /tests/include/main-nested-only-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i1 as long 4 | -------------------------------------------------------------------------------- /tests/include/main-nested-only-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i2 as long 4 | -------------------------------------------------------------------------------- /tests/include/main-one-file-only.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i2 as long 4 | -------------------------------------------------------------------------------- /tests/lex/token-text-is-not-a-keyword.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A "int" 4 | -------------------------------------------------------------------------------- /tests/replacements/1.replacements: -------------------------------------------------------------------------------- 1 | convert c: #define A 1 2 | to fb: replaced A 3 | -------------------------------------------------------------------------------- /tests/replacements/2.replacements: -------------------------------------------------------------------------------- 1 | convert c: #define B 2 2 | to fb: replaced B 3 | -------------------------------------------------------------------------------- /tests/replacements/3.replacements: -------------------------------------------------------------------------------- 1 | convert c: #define C 3 2 | to fb: replaced C 3 | -------------------------------------------------------------------------------- /tests/versions/max2.txt: -------------------------------------------------------------------------------- 1 | oops, 1472 APIs -- that's too many, max. is 256, sorry 2 | -------------------------------------------------------------------------------- /tests/addinclude/simple.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -addinclude foo.bi 2 | 3 | void simple(void); 4 | -------------------------------------------------------------------------------- /tests/c/basetype/double-long-long.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static double long long d; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/long-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-long-double.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long long double d; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/long-signed-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long signed char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/long-void.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long void *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/short-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static short char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/short-signed-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static short signed char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/short-void.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static short void *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static unsigned struct UDT i; 3 | -------------------------------------------------------------------------------- /tests/c/bitfield-not-supported-here.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: int i : 1; 4 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-and-semicolon.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: a 4 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-invalid-numlit.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | #define A 123uf 3 | -------------------------------------------------------------------------------- /tests/c/param-missing-initexpr.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(int i =); 4 | -------------------------------------------------------------------------------- /tests/c/param-unexpected-token.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void f(int i j); 4 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/double-alias.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | end type 5 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | end type 5 | -------------------------------------------------------------------------------- /tests/cli/declareversions-order-good.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -declareversions V 1 2 4 8 16 32 2 | -------------------------------------------------------------------------------- /tests/cli/endif-instead-of-endselect.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -case a -endif 2 | -------------------------------------------------------------------------------- /tests/cli/endselect-instead-of-else-or-endif.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -ifdef A -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/endselect-instead-of-endif.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -ifdef A -else -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/unknown-option.txt: -------------------------------------------------------------------------------- 1 | (1): unknown command line option '-foo' 2 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect0-given2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m1() 3 | m1(a, b) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1-given1empty.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m(a) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1-given2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a) 3 | m(a, b) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a, b) 3 | m(a) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-objectlike.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared m as long 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-2.h: -------------------------------------------------------------------------------- 1 | #define m1 __VA_ARGS__ 2 | void m1(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-after-else.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #if 0 3 | #else 4 | #elif 0 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-missing-condition.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #ifdef A 3 | #elif 4 | #endif 5 | -------------------------------------------------------------------------------- /tests/cpp/include/system-include/common.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | extern int common; 4 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-does-not-undefine.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-pointer-to-ref.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: extern int &*p; 4 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-ref-to-ref.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: extern int & &r; 4 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/other2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A3 = A2 4 | -------------------------------------------------------------------------------- /tests/include/include1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int include1; 4 | #include "1.h" 5 | -------------------------------------------------------------------------------- /tests/include/include2.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int include2; 4 | #include "2.h" 5 | -------------------------------------------------------------------------------- /tests/include/main-multiple-files-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i2 as long 4 | -------------------------------------------------------------------------------- /tests/include/main-multiple-files-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i3 as long 4 | -------------------------------------------------------------------------------- /tests/rename/rename_.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -rename_ A 2 | 3 | #define A 1 4 | #define B 2 5 | -------------------------------------------------------------------------------- /tests/rename/strlit.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define M1 "a" 4 | #define M2 asc("b") 5 | -------------------------------------------------------------------------------- /tests/title/simple.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -title "libfoo 1.0" example1.h example2.h 2 | -------------------------------------------------------------------------------- /tests/undefbeforedecl.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef A 4 | const A = 1 5 | #undef B 6 | -------------------------------------------------------------------------------- /tests/c/basetype/long-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long struct UDT i; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-unsigned-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static long unsigned char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/short-unsigned-char.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | static short unsigned char *p; 3 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-void.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static signed void *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-void.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static unsigned void *p; 4 | -------------------------------------------------------------------------------- /tests/c/function-body-not-on-first-declarator.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void *a, b(void) { ; }; 3 | -------------------------------------------------------------------------------- /tests/c/function-body-not-on-last-declarator.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | void a(void) { ; }, *b; 3 | -------------------------------------------------------------------------------- /tests/c/keyword-basetype-missing-id-and-semicolon.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: int 4 | -------------------------------------------------------------------------------- /tests/c/macro-body/line-file.h: -------------------------------------------------------------------------------- 1 | #define linenumber __LINE__ 2 | #define filename __FILE__ 3 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/missing-push-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #pragma pack(pop) 4 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/missing-push-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #pragma pack(pop) 4 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-enum.h: -------------------------------------------------------------------------------- 1 | struct T { 2 | enum E { 3 | A = 123 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-1.h: -------------------------------------------------------------------------------- 1 | union UDT { 2 | union { 3 | int a; 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A as B 4 | -------------------------------------------------------------------------------- /tests/clong32.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -clong32 2 | 3 | extern long myint32; 4 | 5 | #define A 1l 6 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given1empty.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a, b) 3 | m() 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given3.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a, b) 3 | m(a, b, c) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2va-given0.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a, b, ...) 3 | m() 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2va-given1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #define m(a, b, ...) 3 | m(a) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/directive-from-expansion.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #define foo 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-after-pasting.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared m1 as long 4 | -------------------------------------------------------------------------------- /tests/cpp/include/include-with-escape.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "a\nb.bi" 4 | -------------------------------------------------------------------------------- /tests/cpp/include/system-include/sys/common.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | extern int sys_common; 4 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-const-on-ref.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: extern int& const r; 4 | -------------------------------------------------------------------------------- /tests/merging/struct-align.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | i as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/replacements/1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | replaced A 4 | const B = 2 5 | const C = 3 6 | -------------------------------------------------------------------------------- /tests/replacements/2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 1 4 | replaced B 5 | const C = 3 6 | -------------------------------------------------------------------------------- /tests/replacements/3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 1 4 | const B = 2 5 | replaced C 6 | -------------------------------------------------------------------------------- /tests/typedefhint-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define M cast(T, 0) 4 | type T as double 5 | -------------------------------------------------------------------------------- /tests/versions/nested-in-ifdef-true.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -iftarget windows -declarebool X -endif 2 | -------------------------------------------------------------------------------- /tests/c/basetype/double-long-long.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static double long long d; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-long-double.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long long double d; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/short-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static short struct UDT i; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static signed struct UDT i; 4 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-invalid-numlit.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #define A 123uf 4 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/enabled-and-not-disabled.h: -------------------------------------------------------------------------------- 1 | #pragma pack(1) 2 | 3 | struct A { int i; }; 4 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/initially-off.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | i as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-1.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | struct { 3 | int a; 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | typedef int ********T[10]; 3 | void f(T); 4 | -------------------------------------------------------------------------------- /tests/cli/case-behind-caseelse.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -caseelse -case a -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/multiple-declaredefines.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declaredefines A B -declaredefines C D 2 | -------------------------------------------------------------------------------- /tests/cli/unknown-option-behind-declaredefines.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declaredefines A B -foo 2 | -------------------------------------------------------------------------------- /tests/cpp/define-conflicting-duplicate.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m a 4 | #define m b 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-objectlike.h: -------------------------------------------------------------------------------- 1 | // Recursion 2 | #define m m 3 | static int m; // -> m 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/undeffed-isnt-expanded-anymore.h: -------------------------------------------------------------------------------- 1 | #define m foo 2 | #undef m 3 | void m(void); 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-3.h: -------------------------------------------------------------------------------- 1 | #define m2(x) x##__VA_ARGS__ 2 | void m2(aaa)(void); 3 | -------------------------------------------------------------------------------- /tests/cpp/include/nested-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | void nested2(void); 3 | #include "nested-1-1.h" 4 | -------------------------------------------------------------------------------- /tests/cpp/include/system-include/sys/sysonly.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | extern int sys_sysonly; 4 | -------------------------------------------------------------------------------- /tests/lex/stray-byte.bi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freebasic/fbfrog/HEAD/tests/lex/stray-byte.bi -------------------------------------------------------------------------------- /tests/lex/stray-byte.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freebasic/fbfrog/HEAD/tests/lex/stray-byte.h -------------------------------------------------------------------------------- /tests/preinclude-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | extern int preinclude1; 4 | 5 | #define DECL(x) x 6 | -------------------------------------------------------------------------------- /tests/typedefhint-2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -typedefhint T 2 | 3 | #define M (T)0 4 | typedef double T; 5 | -------------------------------------------------------------------------------- /tests/c/basetype/long-inttypedef.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | typedef int myint; 3 | static long myint i; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-signed-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long signed char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/long-unsigned-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static long unsigned char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/short-inttypedef.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | typedef int myint; 3 | static short myint i; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/short-signed-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static short signed char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static unsigned struct UDT i; 4 | -------------------------------------------------------------------------------- /tests/c/extern-block.h: -------------------------------------------------------------------------------- 1 | void f1(void); 2 | extern "C" { 3 | void f2(void); 4 | } 5 | void f3(void); 6 | -------------------------------------------------------------------------------- /tests/c/macro-preferred.h: -------------------------------------------------------------------------------- 1 | void A(int i); 2 | 3 | #define A(i) A(i+1) 4 | 5 | static int i = A(0); 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-solved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | end type 5 | -------------------------------------------------------------------------------- /tests/cli/multiple-declareversions.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declareversions A 1 2 -declaredefines B 3 4 2 | -------------------------------------------------------------------------------- /tests/cli/no-case-behind-select.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -define foo -case a -endselect 2 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/id-string-2.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m a ## "b" 3 | m 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-lhs.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(x) ##x 3 | m(0) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-rhs.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(x) x## 3 | m(0) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/string-id-2.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m "a" ## b 3 | m 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/strings-2.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m "a" ## "b" 3 | m 4 | -------------------------------------------------------------------------------- /tests/cpp/include/simple.h: -------------------------------------------------------------------------------- 1 | void simpleA(void); 2 | #include "simple-1.h" 3 | void simpleB(void); 4 | -------------------------------------------------------------------------------- /tests/cpp/pragma-once-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #pragma once 4 | 5 | #warning inside pragma-once-1.h 6 | -------------------------------------------------------------------------------- /tests/moveabove.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -moveabove c a 2 | extern int a; 3 | extern int b; 4 | extern int c; 5 | -------------------------------------------------------------------------------- /tests/versions/nested-in-case1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -declarebool X -endselect 2 | -------------------------------------------------------------------------------- /tests/versions/nested-in-ifdef-false.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -iftarget windows -else -declarebool X -endif 2 | -------------------------------------------------------------------------------- /tests/versions/nested-in-unreached-if-block.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -ifdef UNDEFINED -declarebool X -endif 2 | -------------------------------------------------------------------------------- /src/common.bi: -------------------------------------------------------------------------------- 1 | #undef FALSE 2 | #undef TRUE 3 | const NULL = 0 4 | const FALSE = 0 5 | const TRUE = -1 6 | -------------------------------------------------------------------------------- /tests/c/basetype/short-unsigned-char.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: static short unsigned char *p; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-inttypedef.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | typedef int myint; 3 | static signed myint i; 4 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-inttypedef.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | typedef int myint; 3 | static unsigned myint i; 4 | -------------------------------------------------------------------------------- /tests/c/function-body-not-on-first-declarator.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: void *a, b(void) { ; } 4 | -------------------------------------------------------------------------------- /tests/c/struct/typedef-union.h: -------------------------------------------------------------------------------- 1 | typedef union U1 { int a; } UU1; 2 | typedef union { int a; } UU2; 3 | -------------------------------------------------------------------------------- /tests/c/struct/typedef-with-nesting.h: -------------------------------------------------------------------------------- 1 | typedef struct { union { struct { int a; int b; }; int c; }; } T; 2 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/tagid-first-used-in-typedef.h: -------------------------------------------------------------------------------- 1 | typedef struct _A A; 2 | struct _A { int i; }; 3 | -------------------------------------------------------------------------------- /tests/cli/multiple-declaredefines.txt: -------------------------------------------------------------------------------- 1 | (1): unknown command line option '-declaredefines' 2 | -------------------------------------------------------------------------------- /tests/cli/multiple-declareversions.txt: -------------------------------------------------------------------------------- 1 | (1): unknown command line option '-declaredefines' 2 | -------------------------------------------------------------------------------- /tests/cpp/define-conflicting-duplicate.h: -------------------------------------------------------------------------------- 1 | // Should be accepted silently 2 | #define m a 3 | #define m b 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1va-given1empty.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m(a, __VA_ARGS__...) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-self-in-arg.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i as long 4 | dim shared i as long 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/params-zero.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m 2 | 3 | #define m() void f(void); 4 | m() 5 | -------------------------------------------------------------------------------- /tests/cpp/guard/a.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | #ifndef HAD_A 3 | #define HAD_A 4 | void inside_a(void); 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/include/include_next/a/1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #include_next <1.h> 4 | 5 | extern int a1; 6 | -------------------------------------------------------------------------------- /tests/cpp/include/include_next/main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -incdir a -incdir b 2 | 3 | #include <1.h> 4 | -------------------------------------------------------------------------------- /tests/cpp/include/notfound.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "header-file-which-does-not-exist.bi" 4 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-without-matching-push-does-not-define.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | -------------------------------------------------------------------------------- /tests/merging/dllimport.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/preinclude-main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -incdir -include preinclude-1.h 2 | 3 | DECL(extern int foo); 4 | -------------------------------------------------------------------------------- /tests/addforwarddecl.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -addforwarddecl T1 2 | 3 | extern struct T1 x1; 4 | extern struct T2 x2; 5 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-in-macro.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v -removedefine m 2 | #define m int a; int b; c; 3 | m 4 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-callconv.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A cptr(sub cdecl(), getFunctionPtr()) 4 | -------------------------------------------------------------------------------- /tests/c/macro-body/ref-unknown-define.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #define A(x) x+ 4 | #define B(x) A(x) 5 | -------------------------------------------------------------------------------- /tests/c/special-identifiers.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub _() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-enum-as-named-field.h: -------------------------------------------------------------------------------- 1 | struct T { 2 | enum E { 3 | A = 123 4 | } x; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-named-field.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | int a; 4 | } a; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-unnamed-field.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | int a; 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | oops, too many pointers on anonymous param 3 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-3.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | void f1(int *******[10]); 3 | void f2(int ********[10]); 4 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-3.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | oops, too many pointers on anonymous param 3 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-proc-impossible-function-result.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | typedef void T(void); 3 | T f(void); 4 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/double-alias.h: -------------------------------------------------------------------------------- 1 | struct a { }; 2 | 3 | typedef struct a a; 4 | typedef struct a A; 5 | -------------------------------------------------------------------------------- /tests/cli/caseelse-behind-caseelse.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -selectdefine -case A -caseelse -caseelse -endselect 2 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1-given1empty.h: -------------------------------------------------------------------------------- 1 | // OK - macro args can be empty 2 | #define m(a) 3 | m() 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/id-string-1.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(l, r) l ## #r 3 | m(a, b) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-operands-objectlike.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m ## 3 | m 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/string-id-1.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(l, r) #l ## r 3 | m(a, b) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/strings-1.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(l, r) #l ## #r 3 | m(a, b) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/params-zero.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/cpp/guard/recursive-b.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #include "recursive-a.h" 4 | 5 | #pragma comment(lib, "b") 6 | -------------------------------------------------------------------------------- /tests/include/includeinclude1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int includeinclude1; 4 | #include "include1.h" 5 | -------------------------------------------------------------------------------- /tests/include/main-multiple-files-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | dim shared i1 as long 4 | dim shared i1 as long 5 | -------------------------------------------------------------------------------- /tests/versions/empty-else-block.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -declarebool X -caseelse -endselect 2 | -------------------------------------------------------------------------------- /tests/versions/empty-if-block.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -caseelse -declarebool X -endselect 2 | -------------------------------------------------------------------------------- /tests/versions/includes/main.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include "1.h" 3 | #else 4 | #include "2.h" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/versions/nested-in-case2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -case dos -declarebool X -endselect 2 | -------------------------------------------------------------------------------- /tests/c/basetype/long-inttypedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type myint as long 4 | '' TODO: static long myint i; 5 | -------------------------------------------------------------------------------- /tests/c/basetype/short-inttypedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type myint as long 4 | '' TODO: static short myint i; 5 | -------------------------------------------------------------------------------- /tests/c/basetype/signed-inttypedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type myint as long 4 | '' TODO: static signed myint i; 5 | -------------------------------------------------------------------------------- /tests/c/decl-basetype-pasted-missing-id.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | 3 | int f; 4 | 5 | #define m(a,b) a##b 6 | m(vo,id); 7 | -------------------------------------------------------------------------------- /tests/c/macro-body/line-file.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define linenumber __LINE__ 4 | #define filename __FILE__ 5 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/disabled-even-though-not-enabled.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | i as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/enabled-and-not-disabled.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A field = 1 4 | i as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/c/register.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f(byval i as long) 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-as-named-field.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | struct UDT2 { 3 | int a; 4 | } a; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-union-as-named-field.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | union UDT2 { 3 | int a; 4 | } a; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-named-field.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | struct { 3 | int a; 4 | } a; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-3.h: -------------------------------------------------------------------------------- 1 | union UDT { 2 | struct { 3 | struct { 4 | int a; 5 | }; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-2.h: -------------------------------------------------------------------------------- 1 | union UDT { 2 | union { 3 | union { 4 | int a; 5 | }; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-3.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | union { 4 | int a; 5 | }; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-1.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | typedef int ********T[10]; 3 | extern T a1; 4 | extern T *a2; 5 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-for-struct-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type udt 4 | a as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-for-struct-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type udt 4 | a as long 5 | end type 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type B 4 | end type 5 | 6 | type A as B 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward.h: -------------------------------------------------------------------------------- 1 | typedef struct A A; 2 | 3 | /* 4 | 5 | type A as A_ 6 | 7 | */ 8 | -------------------------------------------------------------------------------- /tests/cli/case-missing-version-number.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declareversions VER 1 2 -selectversion -case -endselect 2 | -------------------------------------------------------------------------------- /tests/cpp/include/filename-from-macro.h: -------------------------------------------------------------------------------- 1 | #define A "foo.h" 2 | #include A 3 | 4 | #define B 5 | #include B 6 | -------------------------------------------------------------------------------- /tests/include/includenotfound.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | static int includenotfound; 4 | #include "does-not-exist.h" 5 | -------------------------------------------------------------------------------- /tests/include/remove-duplicate-includes.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "1.bi" 4 | #include once "2.bi" 5 | -------------------------------------------------------------------------------- /tests/undefbeforedecl.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -undefbeforedecl A -undefbeforedecl B 2 | 3 | #define A 1 4 | 5 | #undef B 6 | -------------------------------------------------------------------------------- /tests/c/basetype/unsigned-inttypedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type myint as long 4 | '' TODO: static unsigned myint i; 5 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-2.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | struct { 3 | struct { 4 | int a; 5 | }; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-for-struct-1.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | int a; 3 | }; 4 | 5 | typedef struct UDT udt; 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-for-struct-2.h: -------------------------------------------------------------------------------- 1 | typedef struct UDT udt; 2 | 3 | struct UDT { 4 | int a; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward.h: -------------------------------------------------------------------------------- 1 | typedef struct B A; 2 | 3 | /* 4 | 5 | type A as B 6 | 7 | */ 8 | -------------------------------------------------------------------------------- /tests/cli/select-unknown-version-number.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declareversions V 1 2 3 -selectversion -case 4 -endselect 2 | -------------------------------------------------------------------------------- /tests/cli/unknown-option-behind-declaredefines.txt: -------------------------------------------------------------------------------- 1 | (1): unknown command line option '-declaredefines' 2 | -------------------------------------------------------------------------------- /tests/clong32.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern myint32 as long 6 | const A = 1 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-zeroargs-missing-parentheses.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m1() 123 4 | dim shared m1 as long 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub m1() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-operands-functionlike.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | #define m(x) ## 3 | m(0) 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/nonhexdigits.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | '' TODO: A = 0xG 6 | end enum 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/nonoctdigits.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | '' TODO: A = 08 6 | end enum 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/nonoctdigits.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v -removedefine m 2 | #define m 0 ## 8 3 | enum E { 4 | A = m 5 | }; 6 | -------------------------------------------------------------------------------- /tests/cpp/guard/recursive-a.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | 5 | #inclib "a" 6 | #inclib "b" 7 | #inclib "a" 8 | -------------------------------------------------------------------------------- /tests/cpp/if/eval-expr.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define DEFINED 4 | #undef KNOWNUNDEFINED 5 | const DEFINED123 = 123 6 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-without-push-does-not-define.h: -------------------------------------------------------------------------------- 1 | #pragma pop_macro("A") 2 | #ifdef A 3 | #error 4 | #endif 5 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-undefined-does-not-define.h: -------------------------------------------------------------------------------- 1 | #pragma push_macro("A") 2 | #ifdef A 3 | #error 4 | #endif 5 | -------------------------------------------------------------------------------- /tests/lex/open-char-literal.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/lex/open-char-literal.h(2): string/char literal left open 3 | -------------------------------------------------------------------------------- /tests/lex/open-multiline-comment.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/lex/open-multiline-comment.h(4): comment left open 3 | -------------------------------------------------------------------------------- /tests/removevar.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removevar a -removevar b -removevar c 2 | 3 | extern int a; 4 | static int b; 5 | int c; 6 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-and-semicolon-in-macro.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v -removedefine m 2 | #define m int a; int b; c 3 | m 4 | -------------------------------------------------------------------------------- /tests/c/pragma-define.h: -------------------------------------------------------------------------------- 1 | #define PACKEDSTRUCT _Pragma("pack(1)") 2 | #define MULTIPLE _Pragma("a") _Pragma("b") _Pragma("c") 3 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/missing-push-2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | #pragma pack(push, 1) 3 | #pragma pack(pop) 4 | #pragma pack(pop) 5 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-2.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | union { 3 | struct UDT2 { 4 | int a; 5 | }; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-array.h: -------------------------------------------------------------------------------- 1 | struct a { 2 | }; 3 | 4 | typedef struct a A[10]; 5 | 6 | extern A array; 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-array.h: -------------------------------------------------------------------------------- 1 | struct A { 2 | }; 3 | 4 | typedef struct A A[10]; 5 | 6 | extern A array; 7 | -------------------------------------------------------------------------------- /tests/c/vararg-callconv.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f(byval n as long, ...) 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/from-macro-arg.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m(param) param 4 | '' TODO: typedef struct a ## b; 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/nonhexdigits.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v -removedefine m 2 | #define m 0x ## G 3 | enum E { 4 | A = m 5 | }; 6 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-functionlike.h: -------------------------------------------------------------------------------- 1 | // Recursion with params 2 | #define m(x) m(x) 3 | void m(void); // -> m(void) 4 | -------------------------------------------------------------------------------- /tests/cpp/if/elseif.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | /* CPP only accepts #elif, not #elseif */ 3 | #if 1 4 | #elseif 1 5 | #else 6 | #endif 7 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-in-include-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | #include "endif-missing.h" 3 | 4 | // #endif without #if 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-does-not-undefine.h: -------------------------------------------------------------------------------- 1 | #define A 2 | #pragma push_macro("A") 3 | #ifndef A 4 | #error 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-empty.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | dim shared x as long 5 | dim shared y as long 6 | -------------------------------------------------------------------------------- /tests/fbfroginclude.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -fbfroginclude limits.h 2 | 3 | #ifndef CHAR_BIT 4 | #error missing CHAR_BIT 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/lex/open-string-literal.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/lex/open-string-literal.h(2): string/char literal left open 3 | -------------------------------------------------------------------------------- /tests/replacements/1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -replacements 1.replacements 2 | 3 | #define A 1 4 | #define B 2 5 | #define C 3 6 | -------------------------------------------------------------------------------- /tests/replacements/2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -replacements 2.replacements 2 | 3 | #define A 1 4 | #define B 2 5 | #define C 3 6 | -------------------------------------------------------------------------------- /tests/replacements/3.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -replacements 3.replacements 2 | 3 | #define A 1 4 | #define B 2 5 | #define C 3 6 | -------------------------------------------------------------------------------- /tests/versions/nested-in-caseelse.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -case dos -caseelse -declarebool X -endselect 2 | -------------------------------------------------------------------------------- /include/fbfrog/stdbool.h: -------------------------------------------------------------------------------- 1 | #define bool _Bool 2 | #define true 1 3 | #define false 0 4 | #define __bool_true_false_are_defined 1 5 | -------------------------------------------------------------------------------- /tests/c/macro-body/no-recursive-macro.h: -------------------------------------------------------------------------------- 1 | void A(int x); 2 | #define A(x) A(x) 3 | 4 | #define b 1 5 | #define B 2 6 | #define C B 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-const.h: -------------------------------------------------------------------------------- 1 | struct a { 2 | }; 3 | 4 | typedef const struct a A; 5 | 6 | extern A constvar; 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-solved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A as B 4 | 5 | type B 6 | end type 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-const.h: -------------------------------------------------------------------------------- 1 | struct A { 2 | }; 3 | 4 | typedef const struct A A; 5 | 6 | extern A constvar; 7 | -------------------------------------------------------------------------------- /tests/cli/selecttarget.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -define TARGET ITS_WIN32 -endselect 2 | 3 | extern int TARGET; 4 | -------------------------------------------------------------------------------- /tests/cli/title.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -emit '*' title.bi -title a title.h title.h -title b title.h title.h 2 | -------------------------------------------------------------------------------- /tests/constants-in-nested-blocks.h: -------------------------------------------------------------------------------- 1 | #ifdef __LP64__ 2 | #define MY_WORD_SIZE 64 3 | #else 4 | #define MY_WORD_SIZE 32 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-self-call-in-arg.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub m1() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub __VA_ARGS__() 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/cpp/if/elseif.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/elseif.h(4): unknown PP directive 3 | # elseif 1 4 | ^~~~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/float.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | // CPP doesn't support floating point literals in #if expressions 3 | #if 1.0 == 2.0 4 | #endif 5 | -------------------------------------------------------------------------------- /tests/include/main-multiple-files-include1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "1.bi" 4 | 5 | dim shared include1 as long 6 | -------------------------------------------------------------------------------- /tests/c/array-plus-alias.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern array(0 to 9) alias "foo" as long 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/dupdef.h: -------------------------------------------------------------------------------- 1 | void a(void); 2 | void a(void); 3 | 4 | extern int b; 5 | extern int b; 6 | 7 | typedef int c; 8 | typedef int c; 9 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-union.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT2 4 | a as long 5 | end union 6 | 7 | type UDT1 8 | end type 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-enum.h: -------------------------------------------------------------------------------- 1 | enum A { 2 | FOO 3 | }; 4 | 5 | typedef int A; 6 | 7 | static enum A x1; 8 | static A x2; 9 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/endif-missing.h(2): missing #endif 3 | # if 1 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/include/empty-multiple.h: -------------------------------------------------------------------------------- 1 | #include "empty-multiple-1.h" 2 | #include "empty-multiple-2.h" 3 | #include "empty-multiple-3.h" 4 | -------------------------------------------------------------------------------- /tests/cxx/refs/bad-array-of-refs.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern byref array(0 to 9) as long 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/highlevel/expand-typedef.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -expand B 2 | 3 | typedef int A; 4 | typedef int B; 5 | 6 | extern A a; 7 | extern B b; 8 | -------------------------------------------------------------------------------- /tests/versions/iftarget-unix.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -iftarget unix -define OS my_unix -else -define OS my_windos -endif 2 | 3 | extern int OS; 4 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-named-field-2.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | struct { 4 | int a; 5 | } a; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-enum.h: -------------------------------------------------------------------------------- 1 | enum A { 2 | FOO 3 | }; 4 | 5 | typedef int a; 6 | 7 | static enum A x1; 8 | static a x2; 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/tagid-first-used-in-typedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A as _A 4 | 5 | type _A 6 | i as long 7 | end type 8 | -------------------------------------------------------------------------------- /tests/cli/removedefine-missing-arg.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine -v 2 | // Missing argument for -removedefine option 3 | #define m a 4 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/div-by-zero-1.h(2): division by zero 3 | # if 1 / 0 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/div-by-zero-2.h(2): division by zero 3 | # if 1 % 0 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/error-directive.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/error-directive.h(2): #error 3 | # error "Something" 4 | ^~~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-other-in-arg.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub foo() 6 | declare sub foo() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/merge-with-merge-token.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -removedefine m 2 | // undefined behaviour 3 | #define m a ## ## b 4 | m 5 | -------------------------------------------------------------------------------- /tests/cpp/if/duplicate-else.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/duplicate-else.h(4): #else after #else 3 | # else 4 | ^~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/else-without-if.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/else-without-if.h(2): #else without #if 3 | # else 4 | ^~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/endif-missing-2.h(3): missing #endif 3 | # if 1 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-nonempty.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 123 4 | dim shared x as long = 123 5 | dim shared y as long = 123 6 | -------------------------------------------------------------------------------- /tests/cpp/unknown-directive.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/unknown-directive.h(2): unknown PP directive 3 | # foo 4 | ^~~ 5 | -------------------------------------------------------------------------------- /tests/undef/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef sleep 4 | 5 | extern "C" 6 | 7 | declare sub sleep() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/versions/declarebool.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef A 4 | dim shared i1 as long 5 | #else 6 | dim shared i2 as long 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/versions/empty-elseif-block.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -selecttarget -case windows -declarebool X -case dos -caseelse -declarebool Y -endselect 2 | -------------------------------------------------------------------------------- /tests/versions/iftarget-32bit.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -iftarget 32bit -define OS my_32bit -else -define OS my_64bit -endif 2 | 3 | extern int OS; 4 | -------------------------------------------------------------------------------- /tests/versions/iftarget-64bit.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -iftarget 64bit -define OS my_64bit -else -define OS my_32bit -endif 2 | 3 | extern int OS; 4 | -------------------------------------------------------------------------------- /tests/versions/max1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -declarebool A -declarebool B -declarebool C 2 | // should be more than 64 APIs, but still below the limit 3 | -------------------------------------------------------------------------------- /tests/c/callconv-plus-alias.h: -------------------------------------------------------------------------------- 1 | __attribute__((__stdcall__)) void f1(void) asm("f1__"); 2 | __attribute__((__cdecl__)) void f2(void) asm("f2__"); 3 | -------------------------------------------------------------------------------- /tests/c/pragma-comment-lib.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #inclib "foo" 4 | #inclib "foo" 5 | #inclib "foo" 6 | #inclib "foo.a" 7 | #inclib "libfoo" 8 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-unnamed-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | union 5 | a as long 6 | end union 7 | end type 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f(byval as a ptr) 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-union.h: -------------------------------------------------------------------------------- 1 | union A { 2 | double d; 3 | }; 4 | 5 | typedef int A; 6 | 7 | static union A x1; 8 | static A x2; 9 | -------------------------------------------------------------------------------- /tests/cli/select-unknown-version-number.txt: -------------------------------------------------------------------------------- 1 | (1): unknown version number; it didn't appear in the previous -declareversions option 2 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-recursion-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m1(x) m1 6 | declare sub m1() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-functionlike.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m(x) m(x) 6 | declare sub m() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/guard/b.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #ifndef HAD_B 4 | #define HAD_B 5 | 6 | void inside_b(void); 7 | 8 | #endif 9 | 10 | // foo 11 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-after-else.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/elif-after-else.h(4): #elif after #else 3 | # elif 0 4 | ^~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-without-if.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/elif-without-if.h(2): #elif without #if 3 | # elif 0 4 | ^~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-in-include.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/endif-missing.h(2): missing #endif 3 | # if 1 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-without-if.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/endif-without-if.h(2): #endif without #if 3 | # endif 4 | ^~~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/float.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/float.h(3): float literal in CPP expression 3 | # if 1.0 == 2.0 4 | ^~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/include/include_next/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern b1 as long 6 | extern a1 as long 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/unknown-pragma-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/unknown-pragma-2.h(8): unknown #pragma 3 | # pragma ? ? ? 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/unknown-pragma.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/unknown-pragma.h(2): unknown #pragma 3 | # pragma foo 4 | ^~~ 5 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #inclib "1" 4 | 5 | extern "C" 6 | 7 | declare sub f1() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #inclib "2" 4 | 5 | extern "C" 6 | 7 | declare sub f2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/rename/include.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -rename foo.h bar.h 2 | 3 | #ifdef _WIN32 4 | #include "foo.h" 5 | #else 6 | #include "bar.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef 1 4 | 5 | extern "C" 6 | 7 | declare sub f1() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef 2 4 | 5 | extern "C" 6 | 7 | declare sub f2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/versions/target-dos.txt: -------------------------------------------------------------------------------- 1 | [1/1] dos 2 | tests/versions/target-dos.h 3 | emitting: tests/versions/target-dos.bi (0 declarations, 0 TODOs) 4 | -------------------------------------------------------------------------------- /tests/c/array-size-unknown.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern i(0 to ...) as long 6 | extern s as zstring * ... 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/c/macro-body/nested-directive.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define a #define foo 4 | #define b(expr) scope : /' TODO: else #expr '/ : end scope 5 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-enum.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | A = 123 6 | end enum 7 | 8 | type T 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-4.h: -------------------------------------------------------------------------------- 1 | union UDT { 2 | struct { 3 | union { 4 | union { 5 | int a; 6 | }; 7 | }; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-struct.h: -------------------------------------------------------------------------------- 1 | struct A { 2 | double d; 3 | }; 4 | 5 | typedef int A; 6 | 7 | static struct A x1; 8 | static A x2; 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f(byval as A ptr) 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/implicit-forward-unsolved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f(byval as A ptr) 6 | 7 | end extern 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-struct.h: -------------------------------------------------------------------------------- 1 | struct A { 2 | double d; 3 | }; 4 | 5 | typedef int a; 6 | 7 | static struct A x1; 8 | static a x2; 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-union.h: -------------------------------------------------------------------------------- 1 | union A { 2 | double d; 3 | }; 4 | 5 | typedef int a; 6 | 7 | static union A x1; 8 | static a x2; 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1va-given1empty.h: -------------------------------------------------------------------------------- 1 | // OK: 'a' is given an empty arg, and the arg for '...' is omitted 2 | #define m(a, ...) 3 | m() 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-other-in-expansion.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub foo() 6 | declare sub foo() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/recursion-after-pasting.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 2 | // Recursion after pasting 3 | #define m1 m##1 4 | static int m1; // -> m1 5 | -------------------------------------------------------------------------------- /tests/cpp/if/endif-missing-in-include-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/endif-missing.h(2): missing #endif 3 | # if 1 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/if-missing-condition.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/if-missing-condition.h(2): missing expression 3 | # if 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-empty.h: -------------------------------------------------------------------------------- 1 | #define A 2 | #pragma push_macro("A") 3 | A static int x; 4 | 5 | #pragma pop_macro("A") 6 | A static int y; 7 | -------------------------------------------------------------------------------- /tests/cpp/unknown-pragma-2.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | 3 | extern "C" { 4 | 5 | #define M 123 6 | static int i = M; 7 | 8 | #pragma ??? 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/highlevel/forcefunction2macro.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -forcefunction2macro b 2 | 3 | int a(int i) { return i * i; } 4 | int b(int i) { return i * i; } 5 | -------------------------------------------------------------------------------- /tests/merging/typedefs.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | typedef long long myint64; 3 | #else 4 | typedef long myint64; 5 | #endif 6 | 7 | extern myint64 i; 8 | -------------------------------------------------------------------------------- /tests/moveabove.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern c as long 6 | extern a as long 7 | extern b as long 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/remove1st.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define A(x) x 6 | declare sub f2() 7 | #define f() f2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/addforwarddecl.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type T1 as T1_ 6 | extern x1 as T1 7 | extern x2 as T2 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/addinclude/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "foo.bi" 4 | 5 | extern "C" 6 | 7 | declare sub simple() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/code-as-seen-by-fbfrog.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | 3 | void 4 | f 5 | ( 6 | /* Some comment in the 7 | middle of things.*/ 8 | int i; /* invalid code */ 9 | -------------------------------------------------------------------------------- /tests/c/extern-block.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f1() 6 | declare sub f2() 7 | declare sub f3() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/pragma-pack/no-nesting.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type B field = 1 4 | i as long 5 | end type 6 | 7 | type C 8 | i as long 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-4.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | struct { 4 | struct { 5 | int a; 6 | }; 7 | }; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/c/struct/toplevel.h: -------------------------------------------------------------------------------- 1 | struct T1 { 2 | }; 3 | 4 | union T2 { 5 | }; 6 | 7 | struct T3 { 8 | int a; 9 | }; 10 | 11 | struct T4 { int a; }; 12 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-multdecl.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | int a; 3 | } A1, *PA1; 4 | 5 | typedef struct UDT { 6 | int a; 7 | } A2, B2, *C2, (*D2)(void); 8 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-1.h: -------------------------------------------------------------------------------- 1 | struct A { 2 | }; 3 | 4 | typedef struct A A; 5 | 6 | /* 7 | 8 | type A 9 | end type 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/cpp/div-by-zero-3.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/div-by-zero-3.h(2): division by zero 3 | # if 1 / ( 1 % 1 ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-zeroargs-missing-parentheses.h: -------------------------------------------------------------------------------- 1 | #define m1() 123 2 | 3 | // m1 should not be expanded here, missing "()" for that 4 | static int m1; 5 | -------------------------------------------------------------------------------- /tests/include/main-multiple-files-includenotfound.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "does-not-exist.bi" 4 | 5 | dim shared includenotfound as long 6 | -------------------------------------------------------------------------------- /tests/remove2nd.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -remove2nd A -remove2nd B 2 | 3 | #define A(x) 1 4 | #define A(x) 2 5 | 6 | #define B 1 7 | #define B 2 8 | #define B 3 9 | -------------------------------------------------------------------------------- /tests/rename/proc.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renameproc A1 A2 2 | 3 | void A1(void); 4 | 5 | // procptr subtypes shouldn't cause issues 6 | extern void (*p)(void); 7 | -------------------------------------------------------------------------------- /tests/versions/simplifications.fbfrog: -------------------------------------------------------------------------------- 1 | -declareversions V 1 2 2 | -selectversion 3 | -case 1 4 | -define V 1 5 | -case 2 6 | -define V 2 7 | -endselect 8 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | union 5 | type 6 | a as long 7 | end type 8 | end union 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT 4 | type 5 | union 6 | a as long 7 | end union 8 | end type 9 | end union 10 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-fixup-1.h: -------------------------------------------------------------------------------- 1 | // Anonymous, will be given a temp id, requiring AST fix up later 2 | typedef struct { int i; } A, B, C, *D, **E, (*F)(void); 3 | -------------------------------------------------------------------------------- /tests/c/vararg-callconv.h: -------------------------------------------------------------------------------- 1 | // vararg functions are always cdecl; the __stdcall attribute should be ignored here 2 | __attribute__((stdcall)) void f(int n, ...); 3 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-id.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/define-missing-id.h(2): missing identifier behind #define 3 | # define 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-recursion-1.h: -------------------------------------------------------------------------------- 1 | // Incomplete recursive macro call, not expanded 2 | #define m1(x) m1 3 | void m1(void)(void); 4 | // void m1(void); 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/indirect-recursion-objectlike.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m1 m2 4 | #define m2 m1 5 | dim shared m1 as long 6 | dim shared m2 as long 7 | -------------------------------------------------------------------------------- /tests/cpp/guard/c.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | void outside_c(void); 4 | 5 | #ifndef HAD_C 6 | #define HAD_C 7 | 8 | void inside_c(void); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /tests/cpp/guard/d.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #ifndef HAD_D 4 | #define HAD_D 5 | 6 | void inside_d(void); 7 | 8 | #endif 9 | 10 | void outside_d(void); 11 | -------------------------------------------------------------------------------- /tests/cpp/if/elif-missing-condition.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/elif-missing-condition.h(3): missing expression 3 | # elif 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/if/nesting-limit.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/nesting-limit.h(128): #if/#include stack too small, MAXSTACK=128 3 | # if 1 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/push-nonempty.h: -------------------------------------------------------------------------------- 1 | #define A 123 2 | #pragma push_macro("A") 3 | static int x = A; 4 | 5 | #pragma pop_macro("A") 6 | static int y = A; 7 | -------------------------------------------------------------------------------- /tests/highlevel/expand-typedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as long 6 | extern a as A 7 | extern b as long 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/lex/counts-lines-in-line-comment.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | // a \ 3 | b \ 4 | c 5 | 6 | #define m(provoke error and check the line number in the produced message 7 | -------------------------------------------------------------------------------- /tests/merging/linkage.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f0() 6 | declare sub f1() 7 | declare sub f2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/rename/rename_.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' The following symbols have been renamed: 4 | '' constant A => A_ 5 | 6 | const A_ = 1 7 | const B = 2 8 | -------------------------------------------------------------------------------- /tests/versions/combine-sibling-ifblocks-2.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #ifdef i386 3 | extern int win32; 4 | #else 5 | extern int win64; 6 | #endif 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/versions/declarebool.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -declarebool A -ifdef A -define A -endif 2 | 3 | #ifdef A 4 | static int i1; 5 | #else 6 | static int i2; 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/addinclude/bi-file-specific/1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "added1.bi" 4 | 5 | extern "C" 6 | 7 | declare sub f1() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/addinclude/bi-file-specific/2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "added2.bi" 4 | 5 | extern "C" 6 | 7 | declare sub f2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/callconv-plus-alias.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f1 stdcall alias "f1__"() 6 | declare sub f2 alias "f2__"() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/c/forward-referenced-typedef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type T as T_ 6 | extern p as T ptr 7 | type T_ as long 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/statement-expression.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' TODO: #define A1 ({ int i = foo(0); i; }) 4 | #define A2 scope : /' TODO: int a[({ f(); })]; '/ : end scope 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m1 m2 6 | #define m2(x) x 7 | declare sub m2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-other-in-expansion.h: -------------------------------------------------------------------------------- 1 | #define m1(x) m2 2 | #define m2(x) x 3 | 4 | m1(0)(static int a;) 5 | m2(static int b;) 6 | static int c; 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/params-none.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f() 6 | declare sub foo() 7 | declare sub f() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/if/ifdef-missing-id.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/ifdef-missing-id.h(2): missing identifier behind 'ifdef' 3 | # ifdef 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "other1.bi" 4 | #include once "other2.bi" 5 | 6 | const A1 = 123 7 | const A2 = A1 8 | -------------------------------------------------------------------------------- /tests/inclib/simple.fbfrog: -------------------------------------------------------------------------------- 1 | -inclib main 2 | -declareversions VER 1 2 3 | 4 | -selectversion 5 | -case 1 -inclib cool1 6 | -case 2 -inclib cool-2.0 7 | -endselect 8 | -------------------------------------------------------------------------------- /tests/lex/counts-lines-in-multiline-comment.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | /* a 3 | b 4 | c */ 5 | 6 | #define m(provoke error and check the line number in the produced message 7 | -------------------------------------------------------------------------------- /tests/remove1st.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -remove1st A -remove1st f 2 | 3 | #define A(x) x 4 | #define A(x) x 5 | 6 | void f2(void); 7 | void f(void); 8 | #define f() f2() 9 | -------------------------------------------------------------------------------- /tests/title/bispecific.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "bispecific-1.bi" 4 | 5 | extern "C" 6 | 7 | declare sub bispecific() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /config.mk 2 | /fbfrog 3 | /fbfrog.exe 4 | /src/obj/*.a 5 | /src/obj/*.o 6 | /tests/run 7 | /tests/run.exe 8 | /unittests/run 9 | /unittests/run.exe 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT2 4 | a as long 5 | end type 6 | 7 | type UDT1 8 | union 9 | end union 10 | end type 11 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-as-named-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT2 4 | a as long 5 | end type 6 | 7 | type UDT1 8 | a as UDT2 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as B 6 | declare sub f(byval as A ptr) 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-solved.h: -------------------------------------------------------------------------------- 1 | typedef struct A A; 2 | 3 | struct A { 4 | }; 5 | 6 | /* 7 | 8 | type A 9 | end type 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/implicit-forward-unsolved.h: -------------------------------------------------------------------------------- 1 | void f(struct A *); 2 | 3 | /* 4 | 5 | type A as A_ 6 | 7 | declare sub f(byval as A ptr) 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /tests/c/unexpanded.h: -------------------------------------------------------------------------------- 1 | // If FOO won't be expanded, the following will become a TODO. 2 | // It should clearly show the problem (macro not expanded). 3 | 4 | FOO int i; 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/undeffed-isnt-expanded-anymore.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m foo 6 | #undef m 7 | declare sub m() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m2(x) x##__VA_ARGS__ 6 | declare sub aaa__VA_ARGS__() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/if/ifndef-missing-id.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/if/ifndef-missing-id.h(2): missing identifier behind 'ifndef' 3 | # ifndef 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-body-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 123 4 | #undef A 5 | #define A 6 | dim shared x as long 7 | dim shared y as long = 123 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-body-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | #undef A 5 | const A = 123 6 | dim shared x as long = 123 7 | dim shared y as long 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-params-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | #undef A 5 | #define A(x) 6 | dim shared x as long = A 7 | dim shared y as long 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-params-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A(x) 4 | #undef A 5 | #define A 6 | dim shared x as long 7 | dim shared y as long = A 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-params-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A(x) 4 | #undef A 5 | #define A(x, y) 6 | dim shared x as long 7 | dim shared y as long 8 | -------------------------------------------------------------------------------- /tests/nofunctionbodies.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare function f1() as long 6 | declare function f2(byval i as long) as long 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/preinclude-main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern preinclude1 as long 6 | #define DECL(x) x 7 | extern foo as long 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/rename/strlit.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -rename a a_ -rename_ b 2 | 3 | // -rename[_] options shouldn't affect string/char literals 4 | 5 | #define M1 "a" 6 | #define M2 'b' 7 | -------------------------------------------------------------------------------- /tests/versions/max2.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -declarebool A -declarebool B -declarebool C -declarebool D -declarebool E -declarebool F 2 | // should be more than the limit 3 | -------------------------------------------------------------------------------- /tests/c/function-body-not-on-last-declarator.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | private sub a() 6 | end sub 7 | 8 | '' TODO: , *b; 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-enum-as-named-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | A = 123 6 | end enum 7 | 8 | type T 9 | x as E 10 | end type 11 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-union-as-named-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT2 4 | a as long 5 | end union 6 | 7 | type UDT1 8 | a as UDT2 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-named-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT_a 4 | a as long 5 | end type 6 | 7 | type UDT 8 | a as UDT_a 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-named-field-2.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | struct { 4 | union { 5 | int a; 6 | } a; 7 | }; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-named-field.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT_a 4 | a as long 5 | end union 6 | 7 | type UDT 8 | a as UDT_a 9 | end type 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-array.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type a 6 | end type 7 | 8 | extern array(0 to 9) as a 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-array.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | end type 7 | 8 | extern array(0 to 9) as A 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/useless-tag-decl.h: -------------------------------------------------------------------------------- 1 | struct struct1; 2 | union union1; 3 | enum enum1; 4 | 5 | const struct struct2; 6 | const union union2; 7 | const enum enum2; 8 | -------------------------------------------------------------------------------- /tests/cli/missing-endif.txt: -------------------------------------------------------------------------------- 1 | (1): missing -endif for this 2 | ./fbfrog tests/cli/missing-endif.h -ifdef A 3 | ^~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/expansion-after-pasting.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m1(x) m##x 4 | #define m2 x2 5 | #define m3 x3 6 | dim shared x2 as long 7 | dim shared x3 as long 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/indirect-recursion-objectlike.h: -------------------------------------------------------------------------------- 1 | // Indirect recursion 2 | #define m1 m2 3 | #define m2 m1 4 | static int m1; // -> m2 -> m1 5 | static int m2; // -> m1 -> m2 6 | -------------------------------------------------------------------------------- /tests/cpp/expand/stringify-first-then-merge.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m 2 | 3 | #define m(x) L ## #x 4 | 5 | void f1(wchar_t *p = m(a)); 6 | void f2(wchar_t *p = L"a"); 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/vaargs-as-normal-id-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub __VA_ARGS__() 6 | declare sub m1 alias "__VA_ARGS__"() 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/include/filename-from-macro.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "foo.bi" 4 | #include once "bar.bi" 5 | 6 | #define A "foo.h" 7 | '' TODO: #define B 8 | -------------------------------------------------------------------------------- /tests/cpp/include/nested.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub nested1() 6 | declare sub nested2() 7 | declare sub nested3() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/include/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub simpleA() 6 | declare sub simple1() 7 | declare sub simpleB() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/include/system-include/main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -incdir sys 2 | 3 | #include "common.h" 4 | #include 5 | #include "sysonly.h" 6 | #include 7 | -------------------------------------------------------------------------------- /tests/versions/target-windows.txt: -------------------------------------------------------------------------------- 1 | [1/2] win32 2 | [2/2] win64 3 | tests/versions/target-windows.h 4 | emitting: tests/versions/target-windows.bi (0 declarations, 0 TODOs) 5 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-datatype.h: -------------------------------------------------------------------------------- 1 | #define MYINT int 2 | #define MYLONG long 3 | #define MYCONSTINT const int 4 | #define MYINTPTR int * 5 | #define MYPROCPTR void (*)(void) 6 | -------------------------------------------------------------------------------- /tests/c/mixed-pp-and-decls.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | A 6 | end enum 7 | 8 | type E as long 9 | enum 10 | A = 1 + 2 11 | B 12 | end enum 13 | -------------------------------------------------------------------------------- /tests/c/mixed-pp-and-decls.h: -------------------------------------------------------------------------------- 1 | enum E { 2 | #if 1 3 | A 4 | #endif 5 | }; 6 | 7 | enum E { 8 | A = 9 | 1 10 | #if 1 11 | + 12 | 2 13 | #endif 14 | , 15 | B 16 | }; 17 | -------------------------------------------------------------------------------- /tests/c/struct/struct-body-in-declaration.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | int a; 3 | } f1(void); 4 | 5 | struct UDT2 { 6 | struct UDT2_1 { 7 | int a; 8 | } a; 9 | } f2(void); 10 | -------------------------------------------------------------------------------- /tests/c/struct/typedef-union.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union U1 4 | a as long 5 | end union 6 | 7 | type UU1 as U1 8 | 9 | union UU2 10 | a as long 11 | end union 12 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-5.h: -------------------------------------------------------------------------------- 1 | union UDT { 2 | union { 3 | struct { 4 | union { 5 | union { 6 | int a; 7 | }; 8 | }; 9 | }; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /tests/cpp/expand/directive-from-expansion.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v -removedefine m 2 | 3 | // CPP doesn't support directives coming from macro expansions 4 | #define m #define foo 5 | m 6 | -------------------------------------------------------------------------------- /tests/cpp/guard/f.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #ifndef HAD_F 4 | #define HAD_F 5 | 6 | void inside_f_1(void); 7 | 8 | #else 9 | 10 | void inside_f_2(void); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-body-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 123 4 | #undef A 5 | const A = 456 6 | dim shared x as long = 456 7 | dim shared y as long = 123 8 | -------------------------------------------------------------------------------- /tests/highlevel/string-does-nothing.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern x as byte 6 | type x as zstring 7 | extern x as zstring ptr 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/lex/counts-lines-for-escaped-eols.h: -------------------------------------------------------------------------------- 1 | // @fail 2 | 3 | \ 4 | \ 5 | \ 6 | \ 7 | \ 8 | 9 | #define m(provoke error and check the line number in the produced message 10 | -------------------------------------------------------------------------------- /tests/merging/struct-align.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #pragma pack(push, 8) 3 | struct UDT { 4 | int i; 5 | }; 6 | #else 7 | struct UDT { 8 | int i; 9 | }; 10 | #endif 11 | -------------------------------------------------------------------------------- /tests/remove.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type LONG_ as long 6 | extern x1 as LONG 7 | extern x2 as LONG_ 8 | declare sub LONG_() 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/versions/combine-sibling-ifblocks.h: -------------------------------------------------------------------------------- 1 | #ifdef __linux__ 2 | extern int linux1; 3 | #ifdef __LP64__ 4 | extern int linux64bit; 5 | #endif 6 | extern int linux2; 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-param-parentheses.h: -------------------------------------------------------------------------------- 1 | #define A1 a 2 | #define A2(a) a 3 | #define A3(a) a + 1 4 | #define A4(a) (a) + 1 5 | #define A5(a) f(a) 6 | #define A6(a, b) f((a) + (b)) 7 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-isnt-scoped.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT2 4 | a as long 5 | end type 6 | 7 | type UDT1 8 | end type 9 | 10 | dim shared x as UDT2 11 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-5.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | struct { 3 | union { 4 | struct { 5 | struct { 6 | int a; 7 | }; 8 | }; 9 | }; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f1(byval as a ptr) 6 | declare sub f2(byval as a ptr) 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | d as double 5 | end type 6 | 7 | type A as long 8 | dim shared x1 as A 9 | dim shared x2 as A 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-union.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union A 4 | d as double 5 | end union 6 | 7 | type A as long 8 | dim shared x1 as A 9 | dim shared x2 as A 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-1.h: -------------------------------------------------------------------------------- 1 | struct B { 2 | }; 3 | 4 | typedef struct B A; 5 | 6 | /* 7 | 8 | type B 9 | end type 10 | 11 | type A as B 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametag-enum.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametag A B 2 | 3 | enum A { 4 | FOO 5 | }; 6 | 7 | typedef int A; 8 | 9 | static enum A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/cpp/defined-as-macro-id.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/defined-as-macro-id.h(2): 'defined' cannot be used as macro name 3 | # define defined 4 | ^~~~~~~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-self-in-arg.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 2 | 3 | // Self called in arg (ok, unlike recursion) 4 | #define m1(x) x 5 | m1(m1(static int i;)) 6 | static int i; 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-recursion-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m1(x) m1 6 | extern m1 as any 7 | dim shared m1 as any 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cpp/expand/no-expansion-before-pasting.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m1 x1 4 | #define m2 x2 5 | #define m3(x) m1##x 6 | dim shared m1m2 as long 7 | dim shared m1m2 as long 8 | -------------------------------------------------------------------------------- /tests/cpp/guard/e.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #ifndef HAD_E 4 | #define HAD_E 5 | 6 | void inside_e_1(void); 7 | 8 | #elif 1 9 | 10 | void inside_e_2(void); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-multiple.h: -------------------------------------------------------------------------------- 1 | #include "simple-multiple-1.h" 2 | void simpleA(void); 3 | #include "simple-multiple-2.h" 4 | void simpleB(void); 5 | #include "simple-multiple-3.h" 6 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const A = 1 4 | dim shared x as long = 1 5 | #undef A 6 | const A = 2 7 | dim shared y as long = 2 8 | dim shared z as long = 1 9 | -------------------------------------------------------------------------------- /tests/cpp/skipping-invalid-directives.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub A1_() 6 | declare sub A1 alias "A1_"() 7 | declare sub A2() 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/highlevel/typedef-defines.h: -------------------------------------------------------------------------------- 1 | #define T5 T1 2 | typedef int T1; 3 | #define T2 T1 4 | #define T3 T1* 5 | #define T4 const T1* 6 | 7 | #define T6 int 8 | #define T7 void (*)(int) 9 | -------------------------------------------------------------------------------- /tests/include/main-dontemit.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "2.bi" 4 | 5 | dim shared a as long 6 | dim shared i1 as long 7 | dim shared i3 as long 8 | dim shared b as long 9 | -------------------------------------------------------------------------------- /tests/include/main-one-file-only.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/2.h' main-one-file-only.bi 2 | 3 | static int a; 4 | #include "1.h" 5 | #include "2.h" 6 | #include "3.h" 7 | static int b; 8 | -------------------------------------------------------------------------------- /tests/lex/open-include-literal.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/lex/open-include-literal.h(2): missing '>' to finish #include <... 3 | # include < foo 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/autoextern/no-callconv-at-all.h: -------------------------------------------------------------------------------- 1 | #define A 2 | #define B 3 | #define C 4 | 5 | struct UDT { 6 | int i; 7 | }; 8 | 9 | typedef int myint; 10 | 11 | static int privatei; 12 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-named-field-3.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | union { 3 | struct { 4 | union { 5 | struct { 6 | } a; 7 | }; 8 | } b; 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A 4 | d as double 5 | end type 6 | 7 | type a as long 8 | dim shared x1 as A 9 | dim shared x2 as a 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-union.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union A 4 | d as double 5 | end union 6 | 7 | type a as long 8 | dim shared x1 as A 9 | dim shared x2 as a 10 | -------------------------------------------------------------------------------- /tests/cli/else-without-ifdef.txt: -------------------------------------------------------------------------------- 1 | (1): -else without -ifdef 2 | ./fbfrog tests/cli/else-without-ifdef.h -else -endif 3 | ^~~~~ 4 | -------------------------------------------------------------------------------- /tests/cli/endif-without-ifdef.txt: -------------------------------------------------------------------------------- 1 | (1): -endif without -ifdef 2 | ./fbfrog tests/cli/endif-without-ifdef.h -endif 3 | ^~~~~~ 4 | -------------------------------------------------------------------------------- /tests/constants-in-nested-blocks.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__FB_64BIT__) and defined(__FB_UNIX__) 4 | const MY_WORD_SIZE = 64 5 | #else 6 | const MY_WORD_SIZE = 32 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-other-in-expansion.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define m1(x) m2 4 | #define m2(x) x 5 | dim shared a as long 6 | dim shared b as long 7 | dim shared c as long 8 | -------------------------------------------------------------------------------- /tests/cpp/unexpanded-if-cond.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/unexpanded-if-cond.h(7): expected end-of-line behind CPP directive but found '(' 3 | # if foo ( 1 ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/dropmacrobodyscopes.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A () 4 | #define B 5 | #define C f1(0) 6 | #macro D 7 | scope 8 | f1(0) 9 | f2(0) 10 | end scope 11 | #endmacro 12 | -------------------------------------------------------------------------------- /tests/include/main-dontemit.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -dontemit '*/2.h' -emit '*' main-dontemit.bi 2 | 3 | static int a; 4 | #include "1.h" 5 | #include "2.h" 6 | #include "3.h" 7 | static int b; 8 | -------------------------------------------------------------------------------- /tests/replacements/4.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -replacements 4.replacements 2 | 3 | #define A 1 4 | extern int i; 5 | #define B 2 6 | #define C 3 7 | void f(void); 8 | #define D /*whitespace*/3 9 | -------------------------------------------------------------------------------- /tests/c/macro-preferred.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub A(byval i as long) 6 | #define A(i) A(i + 1) 7 | dim shared i as long = A(0 + 1) 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct-isnt-scoped.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | struct UDT2 { 3 | int a; 4 | }; 5 | }; 6 | 7 | // UDT2 is visible here, compiles fine with gcc 8 | static struct UDT2 x; 9 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT 4 | type 5 | union 6 | type 7 | a as long 8 | end type 9 | end union 10 | end type 11 | end union 12 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | union 5 | type 6 | union 7 | a as long 8 | end union 9 | end type 10 | end union 11 | end type 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-const.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type a 6 | end type 7 | 8 | type A as const a 9 | extern constvar as A 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used.h: -------------------------------------------------------------------------------- 1 | typedef struct A a; 2 | 3 | void f(a *); 4 | 5 | /* 6 | 7 | type a as a_ 8 | 9 | declare sub f(byval as a ptr) 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/conflict-enum.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A as long 4 | enum 5 | FOO 6 | end enum 7 | 8 | type A as long 9 | dim shared x1 as A 10 | dim shared x2 as A 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-const.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | end type 7 | 8 | type A as const A 9 | extern constvar as A 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-used.h: -------------------------------------------------------------------------------- 1 | typedef struct A A; 2 | 3 | void f(A *); 4 | 5 | /* 6 | 7 | type A as A_ 8 | 9 | declare sub f(byval as A ptr) 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/implicit-forward-solved-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type B as B_ 4 | 5 | type A 6 | b as B ptr 7 | end type 8 | 9 | type B_ 10 | a as A ptr 11 | end type 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/no-conflict-enum.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type A as long 4 | enum 5 | FOO 6 | end enum 7 | 8 | type a as long 9 | dim shared x1 as A 10 | dim shared x2 as a 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametag-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametag A B 2 | 3 | struct A { 4 | double d; 5 | }; 6 | 7 | typedef int A; 8 | 9 | static struct A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametag-union.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametag A B 2 | 3 | union A { 4 | double d; 5 | }; 6 | 7 | typedef int A; 8 | 9 | static union A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametypedef-enum.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametypedef A myint 2 | 3 | enum A { 4 | FOO 5 | }; 6 | 7 | typedef int A; 8 | 9 | static enum A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/cpp/include/angle-brackets-no-macro-expansion.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "foo/1.bi" 4 | #include once "1/2.bi" 5 | 6 | const foo = 1 7 | '' TODO: #define filename 8 | -------------------------------------------------------------------------------- /tests/merging/dllimport.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine API 2 | 3 | #ifdef _WIN32 4 | #define API __declspec(dllimport) 5 | #else 6 | #define API 7 | #endif 8 | 9 | API void f(void); 10 | -------------------------------------------------------------------------------- /tests/autoextern/vars.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern defaultextern as long 6 | dim shared defaultextern as long 7 | extern externonly as long 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/c/macro-body/ref-unknown-define.h: -------------------------------------------------------------------------------- 1 | // This is turned into a TODO 2 | #define A(x) x+ 3 | 4 | // And in this #define body we actually reference A which we failed to parse 5 | #define B(x) A(x) 6 | -------------------------------------------------------------------------------- /tests/c/statement-expression.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | // GCC's "({...})" statement-expressions can't be translated to FB 3 | #define A1 ({ int i = foo(0); i; }) 4 | 5 | #define A2 { int a[({ f(); })]; } 6 | -------------------------------------------------------------------------------- /tests/c/struct/struct-body-followed-by-field-declarators.h: -------------------------------------------------------------------------------- 1 | struct UDT { 2 | struct { int a; } a; 3 | struct { int a; } b, c, d; 4 | struct { int a; } *e; 5 | struct { int a; } (*f)(void); 6 | }; 7 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-solved.h: -------------------------------------------------------------------------------- 1 | typedef struct B A; 2 | 3 | struct B { 4 | }; 5 | 6 | /* 7 | 8 | type A as B 9 | 10 | type B 11 | end type 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-used.h: -------------------------------------------------------------------------------- 1 | typedef struct B A; 2 | 3 | void f(A *); 4 | 5 | /* 6 | 7 | type A as B 8 | 9 | declare sub f(byval as A ptr) 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/cli/case-without-select.txt: -------------------------------------------------------------------------------- 1 | (1): -case without -select 2 | ./fbfrog tests/cli/case-without-select.h -case a -endselect 3 | ^~~~~ 4 | -------------------------------------------------------------------------------- /tests/cli/selecttarget.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #ifdef __FB_WIN32__ 6 | extern ITS_WIN32 as long 7 | #else 8 | extern TARGET as long 9 | #endif 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/cpp/dividers-inside-statements.h: -------------------------------------------------------------------------------- 1 | enum E { 2 | FOO = 1 3 | 4 | }; 5 | 6 | static int a 7 | 8 | ; 9 | 10 | static int b; 11 | #define b2 12 | 13 | static int c; 14 | #define c2 15 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-other-in-arg.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 2 | 3 | #define m1(x) void x(foo)(void) 4 | #define m2(x) x 5 | 6 | m1(m2); 7 | void m2(foo)(void); 8 | void foo(void); 9 | -------------------------------------------------------------------------------- /tests/dropprocbody.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -dropprocbody add2 2 | 3 | int add1(int i) { 4 | add1(i); 5 | return i + 1; 6 | } 7 | 8 | int add2(int i) { 9 | add2(i); 10 | return i + 2; 11 | } 12 | -------------------------------------------------------------------------------- /tests/highlevel/self-alias-define.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type T as long 6 | declare sub f() 7 | 8 | enum 9 | E1 = 1 10 | E2 = 2 11 | end enum 12 | 13 | end extern 14 | -------------------------------------------------------------------------------- /tests/lex/escaped-eol.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f() 6 | declare sub f() 7 | type b as a 8 | type b as a 9 | type b as a 10 | type b as a 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/merging/callconv.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if VER = 1 4 | extern "Windows" 5 | #else 6 | extern "C" 7 | #endif 8 | 9 | declare sub f1() 10 | declare sub f2() 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/merging/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern a1 as long 6 | 7 | #if VER = 1 8 | extern a2 as long 9 | #endif 10 | 11 | extern a3 as long 12 | 13 | end extern 14 | -------------------------------------------------------------------------------- /tests/merging/versions.fbfrog: -------------------------------------------------------------------------------- 1 | -declareversions VER 1 2 3 2 | 3 | -selectversion 4 | -case 1 5 | -define VER 1 6 | -case 2 7 | -define VER 2 8 | -case 3 9 | -define VER 3 10 | -endselect 11 | -------------------------------------------------------------------------------- /tests/versions/declareversions.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if VER = 1 4 | dim shared i1 as long 5 | #elseif VER = 2 6 | dim shared i2 as long 7 | #else 8 | dim shared i3 as long 9 | #endif 10 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-union.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | union UDT2 { 3 | int a; 4 | }; // gcc: warning: declaration does not declare anything 5 | }; 6 | // sizeof(UDT1) = 0, UDT2 does not become a field 7 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-named-field-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT_a 4 | a as long 5 | end type 6 | 7 | type UDT 8 | union 9 | a as UDT_a 10 | end union 11 | end type 12 | -------------------------------------------------------------------------------- /tests/c/struct/typedef-with-nesting.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type T 4 | union 5 | type 6 | a as long 7 | b as long 8 | end type 9 | 10 | c as long 11 | end union 12 | end type 13 | -------------------------------------------------------------------------------- /tests/c/too-many-pointers/highlevel-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | oops, can't expand typedef T(0 to 9) as long ptr ptr ptr ptr ptr ptr ptr ptr into variable a2 as T ptr: too many pointers, or ref to ref 3 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-fixup-3.h: -------------------------------------------------------------------------------- 1 | typedef struct AAA { 2 | int i; 3 | } AAA; 4 | 5 | static AAA *p; 6 | void f(AAA *p); 7 | 8 | struct BBB { 9 | AAA aaa; 10 | }; 11 | 12 | typedef AAA CCC; 13 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametypedef-union.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametypedef A myint 2 | 3 | union A { 4 | double d; 5 | }; 6 | 7 | typedef int A; 8 | 9 | static union A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/cli/title-bispecific.h: -------------------------------------------------------------------------------- 1 | // @fail @fbfrog -emit '*' title-bispecific.bi -title a title.h title.h title-bispecific.bi -title b title.h title.h title-bispecific.bi 2 | -------------------------------------------------------------------------------- /tests/cli/title.txt: -------------------------------------------------------------------------------- 1 | (1): duplicate -title option 2 | a tests/cli/title.h tests/cli/title.h -title b tests/cli/title.h tests/cli/t 3 | ^~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-other-in-expansion.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 -removedefine m2 2 | 3 | // Other macro called in body 4 | #define m1 void m2(void); 5 | #define m2 foo 6 | m1 7 | void foo(void); 8 | -------------------------------------------------------------------------------- /tests/cpp/expand/expansion-after-pasting.h: -------------------------------------------------------------------------------- 1 | // Expansion after pasting 2 | #define m1(x) m##x 3 | #define m2 x2 4 | #define m3 x3 5 | static int m1(2); // -> m2 -> x2 6 | static int m1(3); // -> m3 -> x3 7 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-other-in-arg.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m2(x) x 6 | declare sub foo() 7 | declare sub foo() 8 | declare sub foo() 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/from-macro-arg.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | // should become 3 | // typedef struct a ## b; 4 | // not 5 | // typedef struct ab; 6 | #define m(param) param 7 | typedef struct m(a ## b); 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-undefines.h: -------------------------------------------------------------------------------- 1 | #pragma push_macro("A") 2 | 3 | #define A 4 | #ifndef A 5 | #error 6 | #endif 7 | 8 | #pragma pop_macro("A") 9 | #ifdef A 10 | #error 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/versions/declareversions.fbfrog: -------------------------------------------------------------------------------- 1 | -declareversions VER 1 2 3 2 | -selectversion 3 | -case 1 4 | -define VER 1 5 | -case 2 6 | -define VER 2 7 | -case 3 8 | -define VER 3 9 | -endselect 10 | -------------------------------------------------------------------------------- /tests/versions/iftarget-unix.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #ifdef __FB_UNIX__ 6 | extern my_unix as long 7 | #else 8 | extern my_windos as long 9 | #endif 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/asm-alias.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -rename x1 x2 2 | 3 | extern int a asm("b"); 4 | extern int a __asm("b"); 5 | extern int a __asm__("b"); 6 | 7 | void f1(void) __asm("f2"); 8 | 9 | extern int x1; 10 | -------------------------------------------------------------------------------- /tests/c/decl-basetype-pasted-missing-id.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern f as long 6 | dim shared f as long 7 | #define m(a, b) a##b 8 | '' TODO: void; 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/c/dupdef.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub a() 6 | declare sub a() 7 | extern b as long 8 | extern b as long 9 | type c as long 10 | type c as long 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/c/forward-referenced-typedef.h: -------------------------------------------------------------------------------- 1 | // Illegal C, but still the situation could happen in fbfrog's AST after 2 | // highlevel transformations, and FB supports it... 3 | 4 | extern T *p; 5 | typedef int T; 6 | -------------------------------------------------------------------------------- /tests/c/struct/toplevel.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type T1 4 | end type 5 | 6 | union T2 7 | end union 8 | 9 | type T3 10 | a as long 11 | end type 12 | 13 | type T4 14 | a as long 15 | end type 16 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-solved-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | a as A ptr 7 | end type 8 | 9 | declare sub f(byval as A ptr) 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/implicit-forward-solved-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as A_ 6 | declare sub f(byval as A ptr) 7 | 8 | type A_ 9 | end type 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/renametypedef-struct.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -renametypedef A myint 2 | 3 | struct A { 4 | double d; 5 | }; 6 | 7 | typedef int A; 8 | 9 | static struct A x1; 10 | static A x2; 11 | -------------------------------------------------------------------------------- /tests/cli/else-behind-else.txt: -------------------------------------------------------------------------------- 1 | (1): -else behind -else 2 | ./fbfrog tests/cli/else-behind-else.h -ifdef A -else -else -endif 3 | ^~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect0-given1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect0-given1.h(3): expected ')' to close macro call argument list but found 'a' 3 | m1 ( a ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect2-given1.h(3): not enough arguments for 'm' macro call: 1 given, 2 needed 3 | m ( a ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2va-given0.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect2va-given0.h(3): not enough arguments for 'm' macro call: 2 given, 3 needed 3 | m ( ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-other-in-arg.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 -removedefine m2 2 | 3 | // Other macro called in arg 4 | #define m1(a) void a(void); 5 | #define m2 foo 6 | m1(m2) 7 | 8 | void foo(void); 9 | -------------------------------------------------------------------------------- /tests/cpp/include/include-missing-filename.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/include/include-missing-filename.h(2): missing "filename" or behind #include 3 | # include 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/merging/simple.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -declareversions VER 1 2 -selectversion -case 1 -define A -endselect 2 | 3 | extern int a1; 4 | 5 | #ifdef A 6 | extern int a2; 7 | #endif 8 | 9 | extern int a3; 10 | -------------------------------------------------------------------------------- /tests/rename/with-alias.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' The following symbols have been renamed: 4 | '' variable a => b 5 | 6 | extern "C" 7 | 8 | extern b alias "c" as long 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/replacements/5.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -replacements 5.replacements 2 | 3 | #define A 1 4 | static const int B = 2; 5 | static const int C = 3; 6 | 7 | static int f(void) { 8 | return i++; 9 | } 10 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef main 4 | 5 | #include once "1.bi" 6 | #include once "2.bi" 7 | 8 | extern "C" 9 | 10 | declare sub main() 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-param-parentheses.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A1 a 4 | #define A2(a) a 5 | #define A3(a) (a + 1) 6 | #define A4(a) ((a) + 1) 7 | #define A5(a) f(a) 8 | #define A6(a, b) f((a) + (b)) 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used-solved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type a as a_ 6 | declare sub f(byval as a ptr) 7 | 8 | type a_ 9 | end type 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | end type 7 | 8 | declare sub f1(byval as A ptr) 9 | declare sub f2(byval as A ptr) 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | end type 7 | 8 | declare sub f1(byval as A ptr) 9 | declare sub f2(byval as A ptr) 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/cli/endselect-without-select.txt: -------------------------------------------------------------------------------- 1 | (1): -endselect without -select 2 | ./fbfrog tests/cli/endselect-without-select.h -endselect 3 | ^~~~~~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cli/ifdef-non-id.txt: -------------------------------------------------------------------------------- 1 | (1): expected identifier (valid symbol name) but found '123' 2 | ./fbfrog tests/cli/ifdef-non-id.h -ifdef 123 -endif 3 | ^~~ 4 | -------------------------------------------------------------------------------- /tests/cli/missing-endselect.txt: -------------------------------------------------------------------------------- 1 | (1): missing -endselect for this 2 | ./fbfrog tests/cli/missing-endselect.h -selectdefine -case a 3 | ^~~~~ 4 | -------------------------------------------------------------------------------- /tests/cli/title-bispecific.txt: -------------------------------------------------------------------------------- 1 | (1): duplicate -title option 2 | title.h tests/cli/title-bispecific.bi -title b tests/cli/title.h tests/cli/t 3 | ^~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-param-id-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/define-missing-param-id-1.h(2): expected macro parameter (identifier or '...') but found ',' 3 | # define m ( , ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect0-given2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect0-given2.h(3): expected ')' to close macro call argument list but found 'a' 3 | m1 ( a , b ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect1-given2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect1-given2.h(3): too many arguments for 'm' macro call: 2 given, 1 needed 3 | m ( a , b ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given1empty.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect2-given1empty.h(3): not enough arguments for 'm' macro call: 1 given, 2 needed 3 | m ( ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2va-given1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect2va-given1.h(3): not enough arguments for 'm' macro call: 2 given, 3 needed 3 | m ( a ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/indirect-recursion-functionlike.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | #define m1(x) m2(x) 6 | #define m2(x) m1(x) 7 | declare sub m1() 8 | declare sub m2() 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/id-string-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/id-string-2.h(2): ## merge operator cannot merge 'a' and '"b"' 3 | m [TK_BEGIN] a ## "b" [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/string-id-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/string-id-2.h(2): ## merge operator cannot merge '"a"' and 'b' 3 | m [TK_BEGIN] "a" ## b [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/strings-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/strings-2.h(2): ## merge operator cannot merge '"a"' and '"b"' 3 | m [TK_BEGIN] "a" ## "b" [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/stringify-first-then-merge.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub f1(byval p as wstring ptr = wstr("a")) 6 | declare sub f2(byval p as wstring ptr = wstr("a")) 7 | 8 | end extern 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/unmerged-tokens-in-merged-arg-still-expanded.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define identifier a 4 | #define m1(x) stat##x 5 | dim shared a as long 6 | type datatype as long 7 | dim shared foo123 as long 8 | -------------------------------------------------------------------------------- /tests/cpp/include/include-missing-eol-1.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | // No EOL at EOF here, but there is a #define which fbfrog's CPP/C parser 3 | // expects to be terminated by an EOL. Thus it must insert an EOL. 4 | #define A 1 -------------------------------------------------------------------------------- /tests/highlevel/cast-addrof-strlit.h: -------------------------------------------------------------------------------- 1 | typedef signed char *myStr; 2 | 3 | #define A (char *)"foo" 4 | #define B (myStr)"foo" 5 | #define C (int *)"123" 6 | #define D (char *)&"foo" 7 | #define E (char *)"a" "b" 8 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #inclib "main" 4 | 5 | #include once "1.bi" 6 | #include once "2.bi" 7 | 8 | extern "C" 9 | 10 | declare sub main() 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/include/removeinclude.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/removeinclude.h' removeinclude.bi -removeinclude 2.h -removeinclude does-not-exist.h 2 | 3 | #include "1.h" 4 | #include "2.h" 5 | #include "does-not-exist.h" 6 | -------------------------------------------------------------------------------- /tests/versions/declareversions.h: -------------------------------------------------------------------------------- 1 | // @fbfrog declareversions.fbfrog 2 | 3 | #if VER == 1 4 | static int i1; 5 | #elif VER == 2 6 | static int i2; 7 | #elif VER == 3 8 | static int i3; 9 | #endif 10 | -------------------------------------------------------------------------------- /tests/autoextern/no-callconv-at-all.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define A 4 | #define B 5 | #define C 6 | 7 | type UDT 8 | i as long 9 | end type 10 | 11 | type myint as long 12 | dim shared privatei as long 13 | -------------------------------------------------------------------------------- /tests/c/macro-body/main-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define X1 cast(A, 0) 4 | #define X2 cast(B, 0) 5 | #define X3 cast(C, 0) 6 | type A as long 7 | type B as long 8 | 9 | type C 10 | i as long 11 | end type 12 | -------------------------------------------------------------------------------- /tests/c/macro-body/no-recursive-macro.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub A(byval x as long) 6 | #define A(x) A(x) 7 | const b = 1 8 | const B = 2 9 | const C = B 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/struct/typedef-struct.h: -------------------------------------------------------------------------------- 1 | typedef struct UDT1 { int a; } A1; 2 | typedef struct { int a; } A2; 3 | 4 | typedef struct UDT3 { 5 | int a; 6 | } A3; 7 | 8 | typedef struct { 9 | int a; 10 | } A4; 11 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-used-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as B 6 | declare sub f1(byval as A ptr) 7 | declare sub f2(byval as B ptr) 8 | 9 | end extern 10 | -------------------------------------------------------------------------------- /tests/cli/caseelse-without-select.txt: -------------------------------------------------------------------------------- 1 | (1): -caseelse without -select 2 | ./fbfrog tests/cli/caseelse-without-select.h -caseelse -endselect 3 | ^~~~~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/define-missing-param-id-2.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/define-missing-param-id-2.h(2): expected macro parameter (identifier or '...') but found ')' 3 | # define m ( a , ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-recursion-2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m2 2 | 3 | // Incomplete recursive macro call, not expanded 4 | #define m1(x) m1 5 | #define m2 (void) 6 | void m1(void) m2; 7 | // void m1 (void); 8 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/simple.h: -------------------------------------------------------------------------------- 1 | #define A 1 2 | static int x = A; 3 | 4 | #pragma push_macro("A") 5 | #undef A 6 | #define A 2 7 | static int y = A; 8 | 9 | #pragma pop_macro("A") 10 | static int z = A; 11 | -------------------------------------------------------------------------------- /tests/include/main-nested-only.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/1.h' main-nested-only-1.bi -emit '*/2.h' main-nested-only-2.bi 2 | 3 | static int a; 4 | #include "include1.h" 5 | #include "include2.h" 6 | static int b; 7 | -------------------------------------------------------------------------------- /tests/addinclude/bi-file-specific/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include once "1.bi" 4 | #include once "2.bi" 5 | #include once "addedmain.bi" 6 | 7 | extern "C" 8 | 9 | declare sub main() 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/macro-body/macro-body-callconv.h: -------------------------------------------------------------------------------- 1 | // Callconvs inside macro bodies mustn't be hidden, because the macro could be 2 | // expanded outside the header's Extern block. 3 | #define A ((void (*)(void)) getFunctionPtr()) 4 | -------------------------------------------------------------------------------- /tests/c/struct/nested-named-struct.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT2 4 | a as long 5 | end type 6 | 7 | type UDT1 8 | end type 9 | 10 | type UDT4 11 | a as long 12 | end type 13 | 14 | type UDT3 15 | end type 16 | -------------------------------------------------------------------------------- /tests/cpp/expand/call-args-expect2-given3.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/call-args-expect2-given3.h(3): too many arguments for 'm' macro call: 3 given, 2 needed 3 | m ( a , b , c ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/dont-expand-arg-too-early.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/dont-expand-arg-too-early.h(7): not enough arguments for 'm' macro call: 1 given, 2 needed 3 | m ( 1 comma 2 ) 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/indirect-recursion-functionlike.h: -------------------------------------------------------------------------------- 1 | // Indirect recursion with params 2 | #define m1(x) m2(x) 3 | #define m2(x) m1(x) 4 | void m1(void); // -> m2(void) -> m1(void) 5 | void m2(void); // -> m1(void) -> m2(void) 6 | -------------------------------------------------------------------------------- /tests/rename/quirk-keyword-types.h: -------------------------------------------------------------------------------- 1 | typedef int INPUT; 2 | 3 | extern INPUT *pinput; 4 | 5 | struct Open { 6 | }; 7 | 8 | typedef struct Open Open; 9 | 10 | extern Open *popen; 11 | 12 | enum Close { 13 | }; 14 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-in-macro.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern a as long 6 | dim shared a as long 7 | extern b as long 8 | dim shared b as long 9 | '' TODO: c; 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-struct-as-unnamed-field.h: -------------------------------------------------------------------------------- 1 | struct UDT1 { 2 | struct { 3 | int a; 4 | }; 5 | }; 6 | 7 | struct UDT2 { 8 | struct { 9 | int a; 10 | char b; 11 | } __attribute__((packed)); 12 | }; 13 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | union 5 | type 6 | union 7 | type 8 | a as long 9 | end type 10 | end union 11 | end type 12 | end union 13 | end type 14 | -------------------------------------------------------------------------------- /tests/c/struct/struct-in-struct-4.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type UDT 4 | union 5 | type 6 | union 7 | type 8 | a as long 9 | end type 10 | end union 11 | end type 12 | end union 13 | end type 14 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT 4 | type 5 | union 6 | type 7 | union 8 | a as long 9 | end union 10 | end type 11 | end union 12 | end type 13 | end union 14 | -------------------------------------------------------------------------------- /tests/c/struct/union-in-union-4.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT 4 | type 5 | union 6 | type 7 | union 8 | a as long 9 | end union 10 | end type 11 | end union 12 | end type 13 | end union 14 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-proc-impossible-function-result.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | oops, can't expand typedef T as declare sub cdecl() into procedure f() as T: can't have a function type as type for function result/cast/sizeof 3 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/exact-alias-forward-used-solved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as A_ 6 | declare sub f(byval as A ptr) 7 | 8 | type A_ 9 | a as A ptr 10 | end type 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/cpp/include/system-include/main.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern common as long 6 | extern sys_common as long 7 | extern sys_sysonly as long 8 | extern sys_sysonly as long 9 | 10 | end extern 11 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-without-matching-push-does-not-define.h: -------------------------------------------------------------------------------- 1 | #define A 2 | #pragma push_macro("A") 3 | #pragma pop_macro("B") 4 | 5 | #ifndef A 6 | #error 7 | #endif 8 | 9 | #ifdef B 10 | #error 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/highlevel/forcefunction2macro.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | private function a(byval i as long) as long 6 | return i * i 7 | end function 8 | 9 | #define b(i) clng((i) * (i)) 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/highlevel/self-alias-define.h: -------------------------------------------------------------------------------- 1 | #define A A 2 | 3 | typedef int T; 4 | #define T T 5 | 6 | void f(void); 7 | #define f f 8 | 9 | enum { 10 | E1 = 1, 11 | E2 = 2 12 | }; 13 | #define E1 E1 14 | #define E2 E2 15 | -------------------------------------------------------------------------------- /tests/highlevel/typedef-expansion-in-define-bodies.h: -------------------------------------------------------------------------------- 1 | #define M1 ((CHAR *)0) 2 | typedef char CHAR; 3 | #define M2 ((CHAR *)0) 4 | 5 | #define M3 ((FUNCTION *)0) 6 | typedef void FUNCTION(void); 7 | #define M4 ((FUNCTION *)0) 8 | -------------------------------------------------------------------------------- /tests/inclib/simple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #inclib "main" 4 | 5 | #if VER = 1 6 | #inclib "cool1" 7 | #else 8 | #inclib "cool-2.0" 9 | #endif 10 | 11 | extern "C" 12 | 13 | declare sub f() 14 | 15 | end extern 16 | -------------------------------------------------------------------------------- /tests/lex/numlit-tokens.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define merge(a, b) a##b 4 | #define stringify(x) #x 5 | dim shared x1 as long = 108 6 | dim shared x2 as zstring * 32 = "111aaazzz" 7 | dim shared x3 as zstring * 32 = "1e+1e+2" 8 | -------------------------------------------------------------------------------- /tests/remove.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -remove LONG 2 | 3 | typedef int LONG; 4 | typedef int LONG; 5 | typedef int LONG; 6 | typedef int LONG_; 7 | extern LONG x1; 8 | extern LONG_ x2; 9 | void LONG(void); 10 | void LONG_(void); 11 | -------------------------------------------------------------------------------- /tests/rename/forwarddecl-should-not-appear-in-renamelist.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type UDT as UDT_ 6 | extern p as UDT ptr 7 | 8 | type UDT_ 9 | dummy as long 10 | end type 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/rename/proc.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | '' The following symbols have been renamed: 4 | '' procedure A1 => A2 5 | 6 | extern "C" 7 | 8 | declare sub A2 alias "A1"() 9 | extern p as sub() 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/struct/nested-unnamed-union-as-named-field-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union UDT_a 4 | a as long 5 | end union 6 | 7 | type UDT 8 | union 9 | type 10 | a as UDT_a 11 | end type 12 | end union 13 | end type 14 | -------------------------------------------------------------------------------- /tests/c/typedef/syntax.h: -------------------------------------------------------------------------------- 1 | typedef UDT A1; 2 | typedef struct UDT A2; 3 | typedef int A3; 4 | typedef int *A4; 5 | typedef int A5, B5, C5; 6 | typedef void (*A6)(void); 7 | typedef UDT (*A7)(UDT); 8 | typedef UDT **A8, B8, (*C8)(int); 9 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-used-solved.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as B 6 | declare sub f(byval as A ptr) 7 | 8 | type B 9 | a as A ptr 10 | end type 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/implicit-forward-solved-1.h: -------------------------------------------------------------------------------- 1 | void f(struct A *); 2 | 3 | struct A { 4 | }; 5 | 6 | /* 7 | 8 | type A as A_ 9 | 10 | declare sub f(byval as A ptr) 11 | 12 | type A_ 13 | end type 14 | 15 | */ 16 | -------------------------------------------------------------------------------- /tests/cpp/dividers-inside-statements.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | type E as long 4 | enum 5 | FOO = 1 6 | end enum 7 | 8 | dim shared a as long 9 | dim shared b as long 10 | #define b2 11 | dim shared c as long 12 | #define c2 13 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-1.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m1 -removedefine m2 2 | 3 | #define m1(x) static int i; 4 | #define m2 (void) 5 | 6 | // m1: incomplete macro call, not expanded 7 | void m1 m2; 8 | // void m1 (void); 9 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/id-string-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/id-string-1.h(2): ## merge operator cannot merge 'a' and '"b"' 3 | m ( a , b ) [TK_BEGIN] a ## "b" [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/merge-with-merge-token.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/merge-with-merge-token.h(3): ## merge operator cannot merge 'a' and '##' 3 | m [TK_BEGIN] a ## ## b [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/string-id-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/string-id-1.h(2): ## merge operator cannot merge '"a"' and 'b' 3 | m ( a , b ) [TK_BEGIN] "a" ## b [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/strings-1.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/strings-1.h(2): ## merge operator cannot merge '"a"' and '"b"' 3 | m ( a , b ) [TK_BEGIN] "a" ## "b" [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/highlevel/alias-defines-moved/main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/main.h' main.bi -emit '*/other1.h' other1.bi -emit '*/other2.h' other2.bi 2 | 3 | #include "other1.h" 4 | 5 | #define A1 123 6 | 7 | #include "other2.h" 8 | -------------------------------------------------------------------------------- /tests/merging/callconv-3.txt: -------------------------------------------------------------------------------- 1 | [1/4] win32 UNICODE 2 | [2/4] win32 (not UNICODE) 3 | [3/4] win64 UNICODE 4 | [4/4] win64 (not UNICODE) 5 | tests/merging/callconv-3.h 6 | emitting: tests/merging/callconv-3.bi (4 declarations, 0 TODOs) 7 | -------------------------------------------------------------------------------- /tests/nofunctionbodies.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -nofunctionbodies 2 | 3 | int f1(void) { 4 | // One that can be parsed just fine 5 | return 123; 6 | } 7 | 8 | int f2(int i) { 9 | // One with a parser error 10 | return i++; 11 | } 12 | -------------------------------------------------------------------------------- /tests/autoextern/cdecl-dominates.h: -------------------------------------------------------------------------------- 1 | void f1(void); 2 | void f2(void); 3 | void f3(void); 4 | void f4(void); 5 | __attribute__((stdcall)) void f5(void); 6 | void f6(void); 7 | void f7(void); 8 | void f8(void); 9 | void f9(void); 10 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type B 6 | end type 7 | 8 | type A as B 9 | declare sub f1(byval as B ptr) 10 | declare sub f2(byval as A ptr) 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-3.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type B 6 | end type 7 | 8 | declare sub f1(byval as B ptr) 9 | type A as B 10 | declare sub f2(byval as A ptr) 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/different-id-alias-forward-solved-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A as B 6 | 7 | type B 8 | a as A ptr 9 | end type 10 | 11 | declare sub f(byval as A ptr) 12 | 13 | end extern 14 | -------------------------------------------------------------------------------- /tests/cpp/include/simple-multiple.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare sub simple1() 6 | declare sub simpleA() 7 | declare sub simple2() 8 | declare sub simpleB() 9 | declare sub simple3() 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/c/id-basetype-missing-id-and-semicolon-in-macro.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern a as long 6 | dim shared a as long 7 | extern b as long 8 | dim shared b as long 9 | '' TODO: c 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/cli/caseelse-behind-caseelse.txt: -------------------------------------------------------------------------------- 1 | (1): -caseelse behind -caseelse 2 | eelse-behind-caseelse.h -selectdefine -case A -caseelse -caseelse -endselect 3 | ^~~~~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-rhs.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/missing-rhs.h(2): ## merge operator at end of macro body, missing operand to merge with 3 | m ( 0 ) [TK_BEGIN] 0 ## [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/replacements/5.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | declare function A() as long 6 | const B = 2 7 | const C = 3 8 | private function f() as long 9 | function = i 10 | i += 1 11 | end function 12 | 13 | end extern 14 | -------------------------------------------------------------------------------- /tests/undef/bi-file-specific/main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/main.h' main.bi -emit '*/1.h' 1.bi -emit '*/2.h' 2.bi -undef main -undef 1 1.bi -undef 2 2.bi 2 | 3 | #include "1.h" 4 | #include "2.h" 5 | 6 | void main(void); 7 | -------------------------------------------------------------------------------- /src/util.bi: -------------------------------------------------------------------------------- 1 | #include once "util-hash.bi" 2 | 3 | declare function min(byval a as integer, byval b as integer) as integer 4 | declare function max(byval a as integer, byval b as integer) as integer 5 | declare sub oops(byval message as zstring ptr) 6 | -------------------------------------------------------------------------------- /tests/c/macro-body/nested-directive.h: -------------------------------------------------------------------------------- 1 | #define a #define foo 2 | 3 | // regression test: the "else" is unexpected and will be skipped; the "#expr" 4 | // shouldn't be treated as CPP directive by the skipping... 5 | #define b(expr) { else #expr } 6 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used-solved-2.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type a as a_ 6 | declare sub f1(byval as a ptr) 7 | declare sub f2(byval as a ptr) 8 | 9 | type a_ 10 | end type 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/cpp/expand/merge/missing-lhs.txt: -------------------------------------------------------------------------------- 1 | [ 1/23] linux-x86 2 | tests/cpp/expand/merge/missing-lhs.h(2): ## merge operator at beginning of macro body, missing operand to merge with 3 | m ( 0 ) [TK_BEGIN] ## 0 [TK_END] 4 | ^~ 5 | -------------------------------------------------------------------------------- /tests/cpp/guard/g.h: -------------------------------------------------------------------------------- 1 | // @ignore 2 | 3 | #ifndef HAD_G_1 4 | #define HAD_G_1 5 | #warning g.h: inside #ifndef HAD_G_1 block 6 | #endif 7 | 8 | #ifndef HAD_G_2 9 | #define HAD_G_2 10 | #warning g.h: inside #ifndef HAD_G_2 block 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/dropprocbody.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | private function add1(byval i as long) as long 6 | add1(i) 7 | return i + 1 8 | end function 9 | 10 | declare function add2(byval i as long) as long 11 | 12 | end extern 13 | -------------------------------------------------------------------------------- /tests/inclib/bi-file-specific/main.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -emit '*/main.h' main.bi -emit '*/1.h' 1.bi -emit '*/2.h' 2.bi -inclib main -inclib 1 1.bi -inclib 2 2.bi 2 | 3 | #include "1.h" 4 | #include "2.h" 5 | 6 | void main(void); 7 | -------------------------------------------------------------------------------- /tests/include/main-default.h: -------------------------------------------------------------------------------- 1 | static int a; 2 | #include "1.h" 3 | #include "2.h" 4 | #include "3.h" 5 | #include "include1.h" 6 | #include "include2.h" 7 | #include "includeinclude1.h" 8 | #include "includenotfound.h" 9 | static int b; 10 | -------------------------------------------------------------------------------- /tests/c/mixed.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | extern a as long 6 | extern a as function() as long ptr 7 | declare function a() as long 8 | declare function a() as long ptr 9 | extern a as function() as long 10 | 11 | end extern 12 | -------------------------------------------------------------------------------- /tests/cli/no-case-behind-select.txt: -------------------------------------------------------------------------------- 1 | (1): expected -case after the -select but found '-define' 2 | sts/cli/no-case-behind-select.h -selectdefine -define foo -case a -endselect 3 | ^~~~~~~ 4 | -------------------------------------------------------------------------------- /tests/cpp/expand/incomplete-call-2.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -removedefine m3 2 | 3 | #define m1 m2 4 | #define m2(x) x 5 | #define m3 (void) 6 | 7 | // m2: incomplete macro call, not expanded 8 | void m1 m3; 9 | // void m2 m3; 10 | // void m2 (void); 11 | -------------------------------------------------------------------------------- /tests/nested-unknowns.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -v 2 | // Unknown constructs nested inside compound blocks 3 | 4 | struct A { 5 | x; 6 | }; 7 | 8 | union B { 9 | x; 10 | }; 11 | 12 | enum C { 13 | x; 14 | }; 15 | 16 | void f(void) { 17 | x=; 18 | } 19 | -------------------------------------------------------------------------------- /tests/rename/with-alias.h: -------------------------------------------------------------------------------- 1 | // @fbfrog -rename a b 2 | 3 | // fbfrog should be able to rename symbols even if they already have an alias, 4 | // and the renamelist should mention the original C identifier, not the alias... 5 | 6 | extern int a asm("c"); 7 | -------------------------------------------------------------------------------- /tests/versions/swapping-nested.txt: -------------------------------------------------------------------------------- 1 | [1/4] win32 UNICODE 2 | [2/4] win32 (not UNICODE) 3 | [3/4] win64 UNICODE 4 | [4/4] win64 (not UNICODE) 5 | tests/versions/swapping-nested.h 6 | emitting: tests/versions/swapping-nested.bi (2 declarations, 0 TODOs) 7 | -------------------------------------------------------------------------------- /tests/c/typedef/typedef-fixup-1.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type A 6 | i as long 7 | end type 8 | 9 | type B as A 10 | type C as A 11 | type D as A ptr 12 | type E as A ptr ptr 13 | type F as function() as A 14 | 15 | end extern 16 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used-2.h: -------------------------------------------------------------------------------- 1 | typedef struct A a; 2 | 3 | void f1(a *); 4 | void f2(struct A *); 5 | 6 | /* 7 | 8 | type a as a_ 9 | 10 | declare sub f1(byval as a ptr) 11 | declare sub f2(byval as a ptr) 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /tests/c/typedefs-and-tags/case-alias-forward-used-solved-used.bi: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" 4 | 5 | type a as a_ 6 | declare sub f1(byval as a ptr) 7 | 8 | type a_ 9 | end type 10 | 11 | declare sub f2(byval as a ptr) 12 | 13 | end extern 14 | -------------------------------------------------------------------------------- /tests/cli/removedefine-missing-arg.txt: -------------------------------------------------------------------------------- 1 | (1): expected parameter for '-removedefine' but found '-v' 2 | ./fbfrog tests/cli/removedefine-missing-arg.h -removedefine -v 3 | ^~ 4 | -------------------------------------------------------------------------------- /tests/cpp/push-pop-macro/pop-restores-body-2.h: -------------------------------------------------------------------------------- 1 | #define A 123 2 | 3 | #pragma push_macro("A") 4 | 5 | // Temporarily redefined with empty body 6 | #undef A 7 | #define A 8 | A static int x; 9 | 10 | #pragma pop_macro("A") 11 | static int y = A; 12 | --------------------------------------------------------------------------------