summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs/naked_functions.ll
blob: c4996d4e7e909de7171656ace83bf47d43369e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; RUN: opt -S -functionattrs %s | FileCheck %s
; RUN: opt -S -passes='function-attrs' %s | FileCheck %s

; Don't change the attributes of parameters of naked functions, in particular
; don't mark them as readnone

@g = common global i32 0, align 4

define i32 @bar() {
entry:
  %call = call i32 @foo(i32* @g)
; CHECK: %call = call i32 @foo(i32* @g)
  ret i32 %call
}

define internal i32 @foo(i32*) #0 {
entry:
  %retval = alloca i32, align 4
  call void asm sideeffect "ldr r0, [r0] \0Abx lr        \0A", ""()
  unreachable
}

; CHECK: define internal i32 @foo(i32* %0)

attributes #0 = { naked }
OpenPOWER on IntegriCloud