aboutsummaryrefslogtreecommitdiffstats
path: root/test/Instrumentation/DataFlowSanitizer/store.ll
blob: 95091777a326664f4a4a08b2d7a460e7eb139d6d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
; RUN: opt < %s -dfsan -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"

define void @store8(i8 %v, i8* %p) {
  ; CHECK: @"dfs$store8"
  ; CHECK: load{{.*}}__dfsan_arg_tls
  ; CHECK: ptrtoint
  ; CHECK: and
  ; CHECK: mul
  ; CHECK: inttoptr
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: store
  store i8 %v, i8* %p
  ret void
}

define void @store16(i16 %v, i16* %p) {
  ; CHECK: @"dfs$store16"
  ; CHECK: load{{.*}}__dfsan_arg_tls
  ; CHECK: ptrtoint
  ; CHECK: and
  ; CHECK: mul
  ; CHECK: inttoptr
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: store
  store i16 %v, i16* %p
  ret void
}

define void @store32(i32 %v, i32* %p) {
  ; CHECK: @"dfs$store32"
  ; CHECK: load{{.*}}__dfsan_arg_tls
  ; CHECK: ptrtoint
  ; CHECK: and
  ; CHECK: mul
  ; CHECK: inttoptr
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: store
  store i32 %v, i32* %p
  ret void
}

define void @store64(i64 %v, i64* %p) {
  ; CHECK: @"dfs$store64"
  ; CHECK: load{{.*}}__dfsan_arg_tls
  ; CHECK: ptrtoint
  ; CHECK: and
  ; CHECK: mul
  ; CHECK: inttoptr
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: insertelement
  ; CHECK: bitcast
  ; CHECK: getelementptr
  ; CHECK: store
  ; CHECK: store
  store i64 %v, i64* %p
  ret void
}