1 ; RUN: opt -S -passes='require<globals-aa>,function-attrs' < %s | FileCheck %s
2 ; RUN: opt -S -O3 < %s | FileCheck %s
4 ; Apart from checking for the direct cause of the bug, we also check
5 ; if any problematic aliasing rules have accidentally snuck into -O3.
7 ; Since the "abc" operand bundle is not a special operand bundle that
8 ; LLVM knows about, all of the stores and loads in @test below have to
11 declare void @foo() readnone
13 ; CHECK-LABEL: define ptr @test(ptr %p)
14 ; CHECK: %a = alloca ptr, align 8
15 ; CHECK: store ptr %p, ptr %a, align 8
16 ; CHECK: call void @foo() [ "abc"(ptr %a) ]
17 ; CHECK: %reload = load ptr, ptr %a, align 8
18 ; CHECK: ret ptr %reload
21 define ptr @test(ptr %p) {
22 %a = alloca ptr, align 8
23 store ptr %p, ptr %a, align 8
24 call void @foo() ["abc" (ptr %a)]
25 %reload = load ptr, ptr %a, align 8