blob: 6d2ca1e446fcd950ba54ab43cb9f977212dacc9d [file] [log] [blame]
Duncan Sands9e89ba32008-12-31 16:14:43 +00001; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {@c.*nocapture}
2; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep nocapture | count 3
3@g = global i32* null ; <i32**> [#uses=1]
4
5define i32* @c1(i32* %p) {
6 ret i32* %p
7}
8
9define void @c2(i32* %p) {
10 store i32* %p, i32** @g
11 ret void
12}
13
14define void @c3(i32* %p) {
15 call void @c2(i32* %p)
16 ret void
17}
18
19define i32 @nc1(i32* %p) {
20 %tmp = bitcast i32* %p to i32* ; <i32*> [#uses=2]
21 %val = load i32* %tmp ; <i32> [#uses=1]
22 store i32 0, i32* %tmp
23 ret i32 %val
24}
25
26define void @nc2(i32* %p) {
27 %1 = call i32 @nc1(i32* %p) ; <i32> [#uses=0]
28 ret void
29}
30
31define void @nc3(void ()* %f) {
32 call void %f()
33 ret void
34}