~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/test/Analysis/Profiling/edge-profiling.ll

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; Test the edge profiling instrumentation.
 
2
; RUN: opt < %s -insert-edge-profiling -S | FileCheck %s
 
3
 
 
4
; ModuleID = '<stdin>'
 
5
 
 
6
@.str = private constant [12 x i8] c"hello world\00", align 1 ; <[12 x i8]*> [#uses=1]
 
7
@.str1 = private constant [6 x i8] c"franz\00", align 1 ; <[6 x i8]*> [#uses=1]
 
8
@.str2 = private constant [9 x i8] c"argc > 2\00", align 1 ; <[9 x i8]*> [#uses=1]
 
9
@.str3 = private constant [9 x i8] c"argc = 1\00", align 1 ; <[9 x i8]*> [#uses=1]
 
10
@.str4 = private constant [6 x i8] c"fritz\00", align 1 ; <[6 x i8]*> [#uses=1]
 
11
@.str5 = private constant [10 x i8] c"argc <= 1\00", align 1 ; <[10 x i8]*> [#uses=1]
 
12
; CHECK:@EdgeProfCounters
 
13
; CHECK:[19 x i32] 
 
14
; CHECK:zeroinitializer
 
15
 
 
16
define void @oneblock() nounwind {
 
17
entry:
 
18
; CHECK:entry:
 
19
; CHECK:%OldFuncCounter
 
20
; CHECK:load 
 
21
; CHECK:getelementptr
 
22
; CHECK:@EdgeProfCounters
 
23
; CHECK:i32 0
 
24
; CHECK:i32 0
 
25
; CHECK:%NewFuncCounter
 
26
; CHECK:add
 
27
; CHECK:%OldFuncCounter
 
28
; CHECK:store 
 
29
; CHECK:%NewFuncCounter
 
30
; CHECK:getelementptr
 
31
; CHECK:@EdgeProfCounters
 
32
  %0 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
33
  ret void
 
34
}
 
35
 
 
36
declare i32 @puts(i8*)
 
37
 
 
38
define i32 @main(i32 %argc, i8** %argv) nounwind {
 
39
entry:
 
40
; CHECK:entry:
 
41
  %argc_addr = alloca i32                         ; <i32*> [#uses=4]
 
42
  %argv_addr = alloca i8**                        ; <i8***> [#uses=1]
 
43
  %retval = alloca i32                            ; <i32*> [#uses=2]
 
44
  %j = alloca i32                                 ; <i32*> [#uses=4]
 
45
  %i = alloca i32                                 ; <i32*> [#uses=4]
 
46
  %0 = alloca i32                                 ; <i32*> [#uses=2]
 
47
; CHECK:call 
 
48
; CHECK:@llvm_start_edge_profiling
 
49
; CHECK:@EdgeProfCounters
 
50
  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
 
51
  store i32 %argc, i32* %argc_addr
 
52
  store i8** %argv, i8*** %argv_addr
 
53
  store i32 0, i32* %i, align 4
 
54
  br label %bb10
 
55
 
 
56
bb:                                               ; preds = %bb10
 
57
; CHECK:bb:
 
58
  %1 = load i32* %argc_addr, align 4              ; <i32> [#uses=1]
 
59
  %2 = icmp sgt i32 %1, 1                         ; <i1> [#uses=1]
 
60
  br i1 %2, label %bb1, label %bb8
 
61
 
 
62
bb1:                                              ; preds = %bb
 
63
; CHECK:bb1:
 
64
  store i32 0, i32* %j, align 4
 
65
  br label %bb6
 
66
 
 
67
bb2:                                              ; preds = %bb6
 
68
; CHECK:bb2:
 
69
  %3 = call i32 @puts(i8* getelementptr inbounds ([6 x i8]* @.str1, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
70
  %4 = load i32* %argc_addr, align 4              ; <i32> [#uses=1]
 
71
  %5 = icmp sgt i32 %4, 2                         ; <i1> [#uses=1]
 
72
  br i1 %5, label %bb3, label %bb4
 
73
 
 
74
bb3:                                              ; preds = %bb2
 
75
; CHECK:bb3:
 
76
  %6 = call i32 @puts(i8* getelementptr inbounds ([9 x i8]* @.str2, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
77
  br label %bb5
 
78
 
 
79
bb4:                                              ; preds = %bb2
 
80
; CHECK:bb4:
 
81
  %7 = call i32 @puts(i8* getelementptr inbounds ([9 x i8]* @.str3, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
82
  br label %bb11
 
83
 
 
84
bb5:                                              ; preds = %bb3
 
85
; CHECK:bb5:
 
86
  %8 = call i32 @puts(i8* getelementptr inbounds ([6 x i8]* @.str4, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
87
  %9 = load i32* %j, align 4                      ; <i32> [#uses=1]
 
88
  %10 = add nsw i32 %9, 1                         ; <i32> [#uses=1]
 
89
  store i32 %10, i32* %j, align 4
 
90
  br label %bb6
 
91
 
 
92
bb6:                                              ; preds = %bb5, %bb1
 
93
; CHECK:bb6:
 
94
  %11 = load i32* %j, align 4                     ; <i32> [#uses=1]
 
95
  %12 = load i32* %argc_addr, align 4             ; <i32> [#uses=1]
 
96
  %13 = icmp slt i32 %11, %12                     ; <i1> [#uses=1]
 
97
  br i1 %13, label %bb2, label %bb7
 
98
 
 
99
bb7:                                              ; preds = %bb6
 
100
; CHECK:bb7:
 
101
  br label %bb9
 
102
 
 
103
bb8:                                              ; preds = %bb
 
104
; CHECK:bb8:
 
105
  %14 = call i32 @puts(i8* getelementptr inbounds ([10 x i8]* @.str5, i64 0, i64 0)) nounwind ; <i32> [#uses=0]
 
106
  br label %bb9
 
107
 
 
108
bb9:                                              ; preds = %bb8, %bb7
 
109
; CHECK:bb9:
 
110
  %15 = load i32* %i, align 4                     ; <i32> [#uses=1]
 
111
  %16 = add nsw i32 %15, 1                        ; <i32> [#uses=1]
 
112
  store i32 %16, i32* %i, align 4
 
113
  br label %bb10
 
114
 
 
115
bb10:                                             ; preds = %bb9, %entry
 
116
; CHECK:bb10:
 
117
  %17 = load i32* %i, align 4                     ; <i32> [#uses=1]
 
118
  %18 = icmp ne i32 %17, 3                        ; <i1> [#uses=1]
 
119
  br i1 %18, label %bb, label %bb11
 
120
; CHECK:br
 
121
; CHECK:label %bb10.bb11_crit_edge
 
122
 
 
123
; CHECK:bb10.bb11_crit_edge:
 
124
; CHECK:br
 
125
; CHECK:label %bb11
 
126
 
 
127
bb11:                                             ; preds = %bb10, %bb4
 
128
; CHECK:bb11:
 
129
  call void @oneblock() nounwind
 
130
  store i32 0, i32* %0, align 4
 
131
  %19 = load i32* %0, align 4                     ; <i32> [#uses=1]
 
132
  store i32 %19, i32* %retval, align 4
 
133
  br label %return
 
134
 
 
135
return:                                           ; preds = %bb11
 
136
; CHECK:return:
 
137
  %retval12 = load i32* %retval                   ; <i32> [#uses=1]
 
138
  ret i32 %retval12
 
139
}