summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ConstantFolding/func-and-folding.ll
blob: eaa55ab06ca5f9d4dad7f796cbf62646e9607859 (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
26
27
; RUN: opt < %s -constprop -S -o - | FileCheck %s

; Function Attrs: minsize norecurse nounwind optsize readnone
define dso_local void @foo1() #0 {
entry:
  ret void
}

; Function Attrs: minsize norecurse nounwind optsize readnone
define dso_local void @foo2() align 4 {
entry:
  ret void
}

; Function Attrs: minsize nounwind optsize
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
; CHECK: ptrtoint
  %call = tail call i32 bitcast (i32 (...)* @process to i32 (i32)*)(i32 and (i32 ptrtoint (void ()* @foo1 to i32), i32 2)) #3
; CHECK-NEXT: ptrtoint
  %call2 = tail call i32 bitcast (i32 (...)* @process to i32 (i32)*)(i32 and (i32 ptrtoint (void ()* @foo2 to i32), i32 2)) #3
  ret i32 0
}

; Function Attrs: minsize optsize
declare dso_local i32 @process(...) local_unnamed_addr #2

OpenPOWER on IntegriCloud