blob: dab62d6f6b24b758151ea29c80af272513c4d6bd [file] [log] [blame]
Peter Collingbourne87f477b2019-01-04 19:27:04 +00001; RUN: opt -S -hwasan < %s | FileCheck %s
2
3target triple = "x86_64-unknown-linux-gnu"
4
5declare void @bar([16 x i32]* %p)
6
7define void @foo() sanitize_hwaddress "hwasan-abi"="interceptor" {
8 ; CHECK: [[LOAD:%[^ ]*]] = load i64, i64* @__hwasan_tls
9 ; CHECK: [[ICMP:%[^ ]*]] = icmp eq i64 [[LOAD]], 0
10 ; CHECK: br i1 [[ICMP]], label %[[INIT:[^,]*]], label %[[CONT:[^,]*]], !prof [[PROF:![0-9]+]]
11
12 ; CHECK: [[INIT]]:
13 ; CHECK: call void @__hwasan_thread_enter()
14 ; CHECK: [[RELOAD:%[^ ]*]] = load i64, i64* @__hwasan_tls
15 ; CHECK: br label %[[CONT]]
16
17 ; CHECK: [[CONT]]:
18 ; CHECK: phi i64 [ [[LOAD]], %0 ], [ [[RELOAD]], %[[INIT]] ]
19
20 %p = alloca [16 x i32]
21 call void @bar([16 x i32]* %p)
22 ret void
23}
24
25; CHECK: [[PROF]] = !{!"branch_weights", i32 1, i32 100000}