~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/test/Analysis/BasicAA/modref.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
; RUN: opt < %s -basicaa -gvn -dse -S | FileCheck %s
 
2
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
 
3
 
 
4
declare void @llvm.memset.i32(i8*, i8, i32, i32)
 
5
declare void @llvm.memset.i8(i8*, i8, i8, i32)
 
6
declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
 
7
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
 
8
declare void @llvm.lifetime.end(i64, i8* nocapture)
 
9
 
 
10
declare void @external(i32*) 
 
11
 
 
12
define i32 @test0(i8* %P) {
 
13
  %A = alloca i32
 
14
  call void @external(i32* %A)
 
15
  
 
16
  store i32 0, i32* %A
 
17
  
 
18
  call void @llvm.memset.i32(i8* %P, i8 0, i32 42, i32 1)
 
19
  
 
20
  %B = load i32* %A
 
21
  ret i32 %B
 
22
  
 
23
; CHECK: @test0
 
24
; CHECK: ret i32 0
 
25
}
 
26
 
 
27
declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
 
28
 
 
29
define i8 @test1() {
 
30
; CHECK: @test1
 
31
  %A = alloca i8
 
32
  %B = alloca i8
 
33
 
 
34
  store i8 2, i8* %B  ;; Not written to by memcpy
 
35
 
 
36
  call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0)
 
37
 
 
38
  %C = load i8* %B
 
39
  ret i8 %C
 
40
; CHECK: ret i8 2
 
41
}
 
42
 
 
43
define i8 @test2(i8* %P) {
 
44
; CHECK: @test2
 
45
  %P2 = getelementptr i8* %P, i32 127
 
46
  store i8 1, i8* %P2  ;; Not dead across memset
 
47
  call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0)
 
48
  %A = load i8* %P2
 
49
  ret i8 %A
 
50
; CHECK: ret i8 1
 
51
}
 
52
 
 
53
define i8 @test2a(i8* %P) {
 
54
; CHECK: @test2
 
55
  %P2 = getelementptr i8* %P, i32 126
 
56
  
 
57
  ;; FIXME: DSE isn't zapping this dead store.
 
58
  store i8 1, i8* %P2  ;; Dead, clobbered by memset.
 
59
  
 
60
  call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0)
 
61
  %A = load i8* %P2
 
62
  ret i8 %A
 
63
; CHECK-NOT: load
 
64
; CHECK: ret i8 2
 
65
}
 
66
 
 
67
define void @test3(i8* %P, i8 %X) {
 
68
; CHECK: @test3
 
69
; CHECK-NOT: store
 
70
; CHECK-NOT: %Y
 
71
  %Y = add i8 %X, 1     ;; Dead, because the only use (the store) is dead.
 
72
  
 
73
  %P2 = getelementptr i8* %P, i32 2
 
74
  store i8 %Y, i8* %P2  ;; Not read by lifetime.end, should be removed.
 
75
; CHECK: store i8 2, i8* %P2
 
76
  call void @llvm.lifetime.end(i64 1, i8* %P)
 
77
  store i8 2, i8* %P2
 
78
; CHECK-NOT: store
 
79
  ret void
 
80
; CHECK: ret void
 
81
}
 
82
 
 
83
define void @test3a(i8* %P, i8 %X) {
 
84
; CHECK: @test3a
 
85
  %Y = add i8 %X, 1     ;; Dead, because the only use (the store) is dead.
 
86
  
 
87
  %P2 = getelementptr i8* %P, i32 2
 
88
  store i8 %Y, i8* %P2  ;; FIXME: Killed by llvm.lifetime.end, should be zapped.
 
89
; CHECK: store i8 %Y, i8* %P2
 
90
  call void @llvm.lifetime.end(i64 10, i8* %P)
 
91
  ret void
 
92
; CHECK: ret void
 
93
}
 
94
 
 
95
@G1 = external global i32
 
96
@G2 = external global [4000 x i32]
 
97
 
 
98
define i32 @test4(i8* %P) {
 
99
  %tmp = load i32* @G1
 
100
  call void @llvm.memset.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1)
 
101
  %tmp2 = load i32* @G1
 
102
  %sub = sub i32 %tmp2, %tmp
 
103
  ret i32 %sub
 
104
; CHECK: @test4
 
105
; CHECK: load i32* @G
 
106
; CHECK: memset.i32
 
107
; CHECK-NOT: load
 
108
; CHECK: sub i32 %tmp, %tmp
 
109
}
 
110
 
 
111
; Verify that basicaa is handling variable length memcpy, knowing it doesn't
 
112
; write to G1.
 
113
define i32 @test5(i8* %P, i32 %Len) {
 
114
  %tmp = load i32* @G1
 
115
  call void @llvm.memcpy.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1)
 
116
  %tmp2 = load i32* @G1
 
117
  %sub = sub i32 %tmp2, %tmp
 
118
  ret i32 %sub
 
119
; CHECK: @test5
 
120
; CHECK: load i32* @G
 
121
; CHECK: memcpy.i32
 
122
; CHECK-NOT: load
 
123
; CHECK: sub i32 %tmp, %tmp
 
124
}
 
125