File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6764,6 +6764,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
6764
6764
case (ASR::cast_kindType::IntegerToUnsignedInteger) : {
6765
6765
int arg_kind = -1 , dest_kind = -1 ;
6766
6766
extract_kinds (x, arg_kind, dest_kind);
6767
+ LCOMPILERS_ASSERT (arg_kind != -1 && dest_kind != -1 )
6767
6768
if ( arg_kind > 0 && dest_kind > 0 &&
6768
6769
arg_kind != dest_kind )
6769
6770
{
@@ -6776,7 +6777,18 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
6776
6777
break ;
6777
6778
}
6778
6779
case (ASR::cast_kindType::UnsignedIntegerToInteger) : {
6779
- // tmp = tmp
6780
+ int arg_kind = -1 , dest_kind = -1 ;
6781
+ extract_kinds (x, arg_kind, dest_kind);
6782
+ LCOMPILERS_ASSERT (arg_kind != -1 && dest_kind != -1 )
6783
+ if ( arg_kind > 0 && dest_kind > 0 &&
6784
+ arg_kind != dest_kind )
6785
+ {
6786
+ if (dest_kind > arg_kind) {
6787
+ tmp = builder->CreateSExt (tmp, getIntType (dest_kind));
6788
+ } else {
6789
+ tmp = builder->CreateTrunc (tmp, getIntType (dest_kind));
6790
+ }
6791
+ }
6780
6792
break ;
6781
6793
}
6782
6794
case (ASR::cast_kindType::CPtrToUnsignedInteger) : {
You can’t perform that action at this time.
0 commit comments