From 7942d7fe72bed4dd9ed7d1258a2b03d58392c1f2 Mon Sep 17 00:00:00 2001 From: Alexey Stepanov Date: Fri, 12 Aug 2016 16:16:32 +0300 Subject: [PATCH] translator: fix boolean type in assert --- kotstd/lib/arm/assert_c.ll | 6 +++--- kotstd/lib/x86/assert_c.ll | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kotstd/lib/arm/assert_c.ll b/kotstd/lib/arm/assert_c.ll index ac836c118dc..3cea44bf31e 100644 --- a/kotstd/lib/arm/assert_c.ll +++ b/kotstd/lib/arm/assert_c.ll @@ -3,9 +3,9 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "thumbv7m-none--eabi" ; Function Attrs: nounwind -define weak void @assert_c(i32 %value) #0 { - %1 = alloca i32, align 4 - store i32 %value, i32* %1, align 4 +define weak void @assert_c(i1 %value) #0 { + %1 = alloca i1, align 4 + store i1 %value, i1* %1, align 4 ret void } diff --git a/kotstd/lib/x86/assert_c.ll b/kotstd/lib/x86/assert_c.ll index 9f32a71fab7..906ee44323a 100644 --- a/kotstd/lib/x86/assert_c.ll +++ b/kotstd/lib/x86/assert_c.ll @@ -5,11 +5,11 @@ target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [71 x i8] c"Exception in thread \22main\22 java.lang.AssertionError: Assertion failed\0A\00", align 1 ; Function Attrs: nounwind uwtable -define void @assert_c(i32 %value) #0 { - %1 = alloca i32, align 4 - store i32 %value, i32* %1, align 4 - %2 = load i32* %1, align 4 - %3 = icmp ne i32 %2, 0 +define weak void @assert_c(i1 %value) #0 { + %1 = alloca i1, align 4 + store i1 %value, i1* %1, align 4 + %2 = load i1* %1, align 4 + %3 = icmp ne i1 %2, 0 br i1 %3, label %6, label %4 ;