37 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; Regression test for https://bugs.llvm.org/show_bug.cgi?id=328423;4; RUN: opt < %s -S -passes=msan 2>&1 | FileCheck %s5 6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"7target triple = "x86_64-unknown-linux-gnu"8 9; Make sure the shadow of the (x < y) comparison isn't truncated to i1.10 11define zeroext i1 @_Z1fii(i32 %x, i32 %y) sanitize_memory {12; CHECK-LABEL: define zeroext i1 @_Z1fii(13; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) #[[ATTR0:[0-9]+]] {14; CHECK-NEXT: [[ENTRY:.*:]]15; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @__msan_param_tls, align 816; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr getelementptr (i8, ptr @__msan_param_tls, i64 8), align 817; CHECK-NEXT: call void @llvm.donothing()18; CHECK-NEXT: [[TMP10:%.*]] = xor i32 [[X]], -214748364819; CHECK-NEXT: [[TMP3:%.*]] = xor i32 [[TMP0]], -120; CHECK-NEXT: [[TMP4:%.*]] = and i32 [[TMP10]], [[TMP3]]21; CHECK-NEXT: [[TMP5:%.*]] = or i32 [[TMP10]], [[TMP0]]22; CHECK-NEXT: [[TMP6:%.*]] = xor i32 [[Y]], -214748364823; CHECK-NEXT: [[TMP7:%.*]] = xor i32 [[TMP1]], -124; CHECK-NEXT: [[TMP8:%.*]] = and i32 [[TMP6]], [[TMP7]]25; CHECK-NEXT: [[TMP9:%.*]] = or i32 [[TMP6]], [[TMP1]]26; CHECK-NEXT: [[TMP14:%.*]] = icmp ult i32 [[TMP4]], [[TMP9]]27; CHECK-NEXT: [[TMP27:%.*]] = icmp ult i32 [[TMP5]], [[TMP8]]28; CHECK-NEXT: [[TMP2:%.*]] = xor i1 [[TMP14]], [[TMP27]]29; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[X]], [[Y]]30; CHECK-NEXT: store i1 [[TMP2]], ptr @__msan_retval_tls, align 831; CHECK-NEXT: ret i1 [[CMP]]32;33entry:34 %cmp = icmp slt i32 %x, %y35 ret i1 %cmp36}37