forked from banach-space/llvm-tutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpcodeCounter.ll
32 lines (26 loc) · 1.11 KB
/
OpcodeCounter.ll
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
28
29
30
31
32
; Legacy PM - OpcodeCounter explicitly requested
; RUN: opt -load %shlibdir/libOpcodeCounter%shlibext -analyze --legacy-opcode-counter %S/Inputs/CallCounterInput.ll 2>&1\
; RUN: | FileCheck %s
; New PM - OpcodeCounter explicitly requested
; RUN: opt -load-pass-plugin %shlibdir/libOpcodeCounter%shlibext -passes="print<opcode-counter>" %S/Inputs/CallCounterInput.ll -disable-output 2>&1\
; RUN: | FileCheck %s
;------------------------------------------------------------------------------
; EXPECTED OUTPUT
;------------------------------------------------------------------------------
; CHECK-LABEL: foo
; CHECK: ret 1
; CHECK-LABEL: bar
; CHECK: ret 1
; CHECK-NEXT: call 1
; CHECK-LABEL: fez
; CHECK: ret 1
; CHECK-NEXT: call 1
; CHECK-LABEL: main
; CHECK: load 2
; CHECK-NEXT: br 4
; CHECK-NEXT: icmp 1
; CHECK-NEXT: add 1
; CHECK-NEXT: ret 1
; CHECK-NEXT: alloca 2
; CHECK-NEXT: store 4
; CHECK-NEXT: call 4