Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: Comparing lists using the == and != operators leads to an LLVM code generation error #2676

Closed
@kmr-srbh

Description

@kmr-srbh
from lpython import i32

my_first_list: list[i32] = [1, 2, 3, 4]
my_second_list: list[i32] = [5, 6, 7, 8]

print(my_first_list == my_second_list)
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
; ModuleID = 'LFortran'
source_filename = "LFortran"

%list = type { i32, i32, i32* }
.
.
.
declare void @_lpython_call_initial_functions(i32, i8**)

attributes #0 = { argmemonly nounwind willreturn }
asr_to_llvm: module failed verification. Error:
Basic Block in function '__module___main_____main__global_stmts' does not have terminator!
label %.entry

code generation error: asr_to_llvm: module failed verification. Error:
Basic Block in function '__module___main_____main__global_stmts' does not have terminator!
label %.entry



Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.

The issue is the same for !=. It does not occur for > and <.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions