brintos

brintos / llvm-project-archived public Read only

0
0
Text · 868 B · 9b9fd71 Raw
28 lines · plain
1; RUN: opt -S -passes='require<globals-aa>,function-attrs' < %s | FileCheck %s2; RUN: opt -S -O3 < %s | FileCheck %s3 4; Apart from checking for the direct cause of the bug, we also check5; if any problematic aliasing rules have accidentally snuck into -O3.6;7; Since the "abc" operand bundle is not a special operand bundle that8; LLVM knows about, all of the stores and loads in @test below have to9; stay.10 11declare void @foo() readnone12 13; CHECK-LABEL: define ptr @test(ptr %p)14; CHECK:   %a = alloca ptr, align 815; CHECK:   store ptr %p, ptr %a, align 816; CHECK:   call void @foo() [ "abc"(ptr %a) ]17; CHECK:   %reload = load ptr, ptr %a, align 818; CHECK:   ret ptr %reload19; CHECK: }20 21define ptr @test(ptr %p) {22  %a = alloca ptr, align 823  store ptr %p, ptr %a, align 824  call void @foo() ["abc" (ptr %a)]25  %reload = load ptr, ptr %a, align 826  ret ptr %reload27}28