brintos

brintos / llvm-project-archived public Read only

0
0
Text · 840 B · ae928fe Raw
31 lines · plain
1; Regression test for msan not invalidating GlobalsAA.2; RUN: opt < %s -S -passes='require<globals-aa>,module(msan),require<globals-aa>,early-cse<memssa>' 2>&1 | FileCheck %s3 4target triple = "x86_64-unknown-linux"5 6define ptr @foo(ptr %p) local_unnamed_addr sanitize_memory {7entry:8  ret ptr %p9}10 11define i32 @test() local_unnamed_addr sanitize_memory {12entry:13  ; CHECK-LABEL: define i32 @test()14 15  %x = alloca i3216  store i32 7, ptr %x17  18  ; CHECK: store i64 0, ptr @__msan_retval_tls19  ; CHECK-NEXT: call ptr @foo(20 21  %call = call ptr @foo(ptr %x)22 23  ; If GlobalsAA is eliminated correctly, early-cse should not remove next load.24  ; CHECK-NEXT: %[[MSRET:.*]] = load i64, ptr @__msan_retval_tls25  ; CHECK-NEXT: %[[MSCMP:.*]] = icmp ne i64 %[[MSRET]], 026  ; CHECK-NEXT: br i1 %[[MSCMP]],27 28  %ret = load i32, ptr %call29  ret i32 %ret30}31