Skip to content

Commit 712b97f

Browse files
committed
Test: added test
1 parent ed168a1 commit 712b97f

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ RUN(NAME test_set_discard LABELS cpython llvm llvm_jit)
595595
RUN(NAME test_set_from_list LABELS cpython llvm llvm_jit)
596596
RUN(NAME test_set_clear LABELS cpython llvm)
597597
RUN(NAME test_set_pop LABELS cpython llvm)
598+
RUN(NAME test_bytes_01 LABELS cpython llvm llvm_jit)
598599
RUN(NAME test_global_set LABELS cpython llvm llvm_jit)
599600
RUN(NAME test_for_loop LABELS cpython llvm llvm_jit c)
600601
RUN(NAME modules_01 LABELS cpython llvm llvm_jit c wasm wasm_x86 wasm_x64)

integration_tests/test_bytes_01.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def f():
2+
a: bytes = b"This is a test string"
3+
b: bytes = b"This is another test string"
4+
c: bytes = b"""Bigger test string with docstrings
5+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
6+
eiusmod tempor incididunt ut labore et dolore magna aliqua. """
7+
8+
9+
def g(a: bytes) -> bytes:
10+
return a
11+
12+
13+
def h() -> bytes:
14+
bar: bytes
15+
bar = g(b"fiwabcd")
16+
return b"12jw19\\xq0"
17+
18+
19+
f()
20+
h()

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,6 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
974974
LCOMPILERS_ASSERT(x.m_symtab->get_symbol(item)
975975
!= nullptr);
976976
ASR::symbol_t *mod = x.m_symtab->get_symbol(item);
977-
std::cout << mod->type << "unit";
978977
visit_symbol(*mod);
979978
}
980979

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,7 +4310,6 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
43104310
}
43114311

43124312
void visit_Module(const AST::Module_t &x) {
4313-
/*Shiju del*/ std::cout << "We here ya yellow bellied mongrels" << "----" << "\n";
43144313
ASR::asr_t *tmp0 = nullptr;
43154314
if (current_scope) {
43164315
LCOMPILERS_ASSERT(current_scope->asr_owner);
@@ -4341,11 +4340,9 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
43414340
module_sym = ASR::down_cast<ASR::Module_t>(ASR::down_cast<ASR::symbol_t>(tmp1));
43424341
parent_scope->add_symbol(module_name, ASR::down_cast<ASR::symbol_t>(tmp1));
43434342
current_module_dependencies.reserve(al, 1);
4344-
/*Shiju del*/ std::cout << "Did way du goodie?" << "----" << "\n";
43454343
for (size_t i=0; i<x.n_body; i++) {
43464344
visit_stmt(*x.m_body[i]);
43474345
}
4348-
/*Shiju del*/ std::cout << "Did we do good?" << "----" << "\n";
43494346

43504347
LCOMPILERS_ASSERT(module_sym != nullptr);
43514348
module_sym->m_dependencies = current_module_dependencies.p;
@@ -5109,7 +5106,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
51095106
}
51105107

51115108
void visit_Module(const AST::Module_t &x) {
5112-
/*Shiju del*/ std::cout << "Inside the Module start" << "---" << "\n";
51135109
ASR::TranslationUnit_t *unit = ASR::down_cast2<ASR::TranslationUnit_t>(asr);
51145110
current_scope = unit->m_symtab;
51155111
LCOMPILERS_ASSERT(current_scope != nullptr);
@@ -5126,12 +5122,10 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
51265122
Vec<ASR::asr_t*> items;
51275123
items.reserve(al, 4);
51285124
current_module_dependencies.reserve(al, 1);
5129-
/*Shiju del*/ std::cout << "Inside the Module visitor" << "---" << "\n";
51305125
for (size_t i=0; i<x.n_body; i++) {
51315126
tmp = nullptr;
51325127
tmp_vec.clear();
51335128
visit_stmt(*x.m_body[i]);
5134-
/*Shiju del*/ std::cout << "Exiting stmt visit" << "----" << "\n";
51355129
for (auto t: global_init) {
51365130
if (t) {
51375131
items.push_back(al, t);
@@ -5168,9 +5162,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
51685162
// Wrap all the global statements into a Function
51695163
LCompilers::PassOptions pass_options;
51705164
pass_options.run_fun = func_name;
5171-
/*Shiju del*/ std::cout << "Random spot" << "----" << "\n";
51725165
pass_wrap_global_stmts(al, *unit, pass_options);
5173-
/*Shiju del*/ std::cout << "Another random spot" << "----" << "\n";
51745166

51755167
ASR::symbol_t *f_sym = unit->m_symtab->get_symbol(func_name);
51765168
if (f_sym) {
@@ -5196,7 +5188,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
51965188
items.p = nullptr;
51975189
items.n = 0;
51985190
}
5199-
/*Shiju del*/ std::cout << "End of the line browski" << "----" << "\n";
52005191

52015192
tmp = asr;
52025193
}
@@ -9043,7 +9034,6 @@ Result<ASR::TranslationUnit_t*> python_ast_to_asr(Allocator &al, LocationManager
90439034
}
90449035

90459036
ASR::TranslationUnit_t *tu = ASR::down_cast2<ASR::TranslationUnit_t>(unit);
9046-
/*shiju*/ std::cout << ";; ASR after SymbolTable Visitor\n" << pickle(*tu, false, true, compiler_options.po.with_intrinsic_mods) << "\n";
90479037
if (compiler_options.po.dump_all_passes) {
90489038
std::ofstream outfile ("pass_00_initial_asr_01.clj");
90499039
outfile << ";; ASR after SymbolTable Visitor\n" << pickle(*tu, false, true, compiler_options.po.with_intrinsic_mods) << "\n";
@@ -9067,7 +9057,6 @@ Result<ASR::TranslationUnit_t*> python_ast_to_asr(Allocator &al, LocationManager
90679057
#endif
90689058

90699059
if (!compiler_options.symtab_only) {
9070-
/*Shiju del*/ std::cout << "Injection" << "---" << "\n";
90719060
auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module, module_name,
90729061
ast_overload, allow_implicit_casting, eval_count);
90739062
if (res2.ok) {

0 commit comments

Comments
 (0)