@@ -3976,6 +3976,9 @@ TEST_F(LLVMCodeBuilderTest, Procedures)
39763976 m_builder->addFunctionCall (" test_print_string" , Compiler::StaticType::Void, { Compiler::StaticType::String }, { v });
39773977 m_builder->addFunctionCall (" test_print_number" , Compiler::StaticType::Void, { Compiler::StaticType::Number }, { v });
39783978
3979+ v = m_builder->addProcedureArgument (" invalid" );
3980+ m_builder->addFunctionCall (" test_print_string" , Compiler::StaticType::Void, { Compiler::StaticType::String }, { v });
3981+
39793982 m_builder->finalize ();
39803983
39813984 // Procedure 2
@@ -3996,12 +3999,16 @@ TEST_F(LLVMCodeBuilderTest, Procedures)
39963999 m_builder->createProcedureCall (&prototype1, { m_builder->addConstValue (" test" ), m_builder->addConstValue (true ), m_builder->addConstValue (false ) });
39974000 m_builder->createProcedureCall (&prototype2, {});
39984001
4002+ v = m_builder->addProcedureArgument (" test" );
4003+ m_builder->addFunctionCall (" test_print_string" , Compiler::StaticType::Void, { Compiler::StaticType::String }, { v });
4004+
39994005 std::string expected1 = " no_args\n " ;
40004006
40014007 std::string expected2 =
40024008 " test\n "
40034009 " true\n "
40044010 " false\n "
4011+ " 0\n "
40054012 " 0\n " ;
40064013
40074014 std::string expected3 =
@@ -4011,12 +4018,15 @@ TEST_F(LLVMCodeBuilderTest, Procedures)
40114018 " false\n "
40124019 " true\n "
40134020 " 1\n "
4021+ " 0\n "
40144022 " no_args\n "
40154023 " no_args\n "
40164024 " -652.3\n "
40174025 " false\n "
40184026 " true\n "
4019- " 1\n " ;
4027+ " 1\n "
4028+ " 0\n "
4029+ " 0\n " ;
40204030
40214031 auto code = m_builder->finalize ();
40224032 Script script (&sprite, nullptr , nullptr );
0 commit comments