• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Regression test for https://bugs.llvm.org/show_bug.cgi?id=32842
2;
3; RUN: opt < %s -msan -S | FileCheck %s
4;target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-unknown-linux-gnu"
6
7define zeroext i1 @_Z1fii(i32 %x, i32 %y) sanitize_memory {
8entry:
9  %cmp = icmp slt i32 %x, %y
10  ret i1 %cmp
11}
12
13; CHECK:      [[X:[^ ]+]] = load{{.*}}__msan_param_tls{{.*}}
14; CHECK:      [[Y:[^ ]+]] = load{{.*}}__msan_param_tls{{.*}}
15; CHECK:      [[OR:[^ ]+]] = or i32 [[Y]], [[X]]
16
17; Make sure the shadow of the (x < y) comparison isn't truncated to i1.
18; CHECK-NOT:  trunc i32 [[OR]] to i1
19; CHECK:      [[CMP:[^ ]+]] = icmp ne i32 [[OR]], 0
20; CHECK:      store i1 [[CMP]],{{.*}}__msan_retval_tls
21