set here [file join [absolute $srcdir] $subdir] set bre_options "s+$here+HERE+g" # ---------- # Test an empty line after a comment started from a macro compile_pass CommentMacro.bsv # ---------- # Syntax error tests (Bug 1845) # XXX we could check for the specific context in the message compile_fail_error NoId_Ifdef.bsv P0222 compile_fail_error NoId_Ifndef.bsv P0222 compile_fail_error NoId_Macro_Include.bsv P0222 compile_fail_error NoId_Macro_Main.bsv P0222 compile_fail_error NoId_Undef.bsv P0222 # ---------- # Test where whitespace is allowed to contain a newline compile_pass MultilineUndef.bsv {-dvpp=MultilineUndef.vpp-out} compare_file_filtered MultilineUndef.vpp-out {} $bre_options compile_pass MultilineIfdef.bsv {-dvpp=MultilineIfdef.vpp-out} compare_file_filtered MultilineIfdef.vpp-out {} $bre_options # ---------- # Test where whitespace is allowed to not contain a newline compile_pass NoNewlineIfdef.bsv {-dvpp=NoNewlineIfdef.vpp-out} compare_file_filtered NoNewlineIfdef.vpp-out {} $bre_options # ---------- # Test the branches for function macros # When the argument has no preprocessor directives compile_pass FuncMacro_Simple.bsv {-dvpp=FuncMacro_Simple.vpp-out} compare_file_filtered FuncMacro_Simple.vpp-out {} $bre_options # When the argument has preprocessor directives that reduce # # This results in `line statements whose position depends on the position # of other `line statements, and thus the numbers vary depending on the # length of the file name, which varies depending on the user's path. # So we filter out the contents of `line statements set ere_options {s+\`line\(.\*\)+\`line\(POS\)+g} compile_pass FuncMacro_ArgReduces.bsv {-dvpp=FuncMacro_ArgReduces.vpp-out} compare_file_filtered FuncMacro_ArgReduces.vpp-out {} {} $ere_options # ----------