summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs/read-write-scc.ll
blob: 319aaf013623367cb4f3ec4115e315ca6e7d9f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RUN: opt -S -functionattrs < %s | FileCheck %s
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s

@i = global i32 0

define void @foo() {
; CHECK-LABEL: define void @foo() #0 {
  store i32 1, i32* @i
  call void @bar()
  ret void
}

define void @bar() {
; CHECK-LABEL: define void @bar() #0 {
  %i = load i32, i32* @i
  call void @foo()
  ret void
}

; CHECK: attributes #0 = { nofree nounwind }
OpenPOWER on IntegriCloud