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 %s
4 target triple = "x86_64-unknown-linux"
6 define ptr @foo(ptr %p) local_unnamed_addr sanitize_memory {
11 define i32 @test() local_unnamed_addr sanitize_memory {
13 ; CHECK-LABEL: define i32 @test()
18 ; CHECK: store i64 0, ptr @__msan_retval_tls
19 ; CHECK-NEXT: call ptr @foo(
21 %call = call ptr @foo(ptr %x)
23 ; If GlobalsAA is eliminated correctly, early-cse should not remove next load.
24 ; CHECK-NEXT: %[[MSRET:.*]] = load i64, ptr @__msan_retval_tls
25 ; CHECK-NEXT: %[[MSCMP:.*]] = icmp ne i64 %[[MSRET]], 0
26 ; CHECK-NEXT: br i1 %[[MSCMP]],
28 %ret = load i32, ptr %call