1 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=0 -S | FileCheck %s
2 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 -S | FileCheck %s
3 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=2 -S | FileCheck %s
5 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
6 target triple = "i686-pc-windows-msvc18.0.0"
8 declare i32 @llvm.eh.typeid.for(ptr) #2
9 declare ptr @llvm.frameaddress(i32)
10 declare ptr @llvm.eh.recoverfp(ptr, ptr)
11 declare ptr @llvm.localrecover(ptr, ptr, i32)
12 declare void @llvm.localescape(...) #1
14 declare i32 @_except_handler3(...)
15 declare void @may_throw(ptr %r)
17 define i32 @main() sanitize_address personality ptr @_except_handler3 {
19 %r = alloca i32, align 4
20 %__exception_code = alloca i32, align 4
21 call void (...) @llvm.localescape(ptr nonnull %__exception_code)
22 store i32 0, ptr %r, align 4
23 invoke void @may_throw(ptr nonnull %r) #4
24 to label %__try.cont unwind label %lpad
26 lpad: ; preds = %entry
27 %0 = landingpad { ptr, i32 }
28 catch ptr @"\01?filt$0@0@main@@"
29 %1 = extractvalue { ptr, i32 } %0, 1
30 %2 = call i32 @llvm.eh.typeid.for(ptr @"\01?filt$0@0@main@@") #1
31 %matches = icmp eq i32 %1, %2
32 br i1 %matches, label %__except, label %eh.resume
34 __except: ; preds = %lpad
35 store i32 1, ptr %r, align 4
38 __try.cont: ; preds = %entry, %__except
39 %3 = load i32, ptr %r, align 4
42 eh.resume: ; preds = %lpad
43 resume { ptr, i32 } %0
46 ; Check that we don't do any instrumentation.
48 ; CHECK-LABEL: define i32 @main()
49 ; CHECK-NOT: load atomic i32, ptr {{.*}} monotonic, align 4, !nosanitize
50 ; CHECK-NOT: call void @__sanitizer_cov
53 ; Function Attrs: nounwind
54 define internal i32 @"\01?filt$0@0@main@@"() #1 {
56 %0 = tail call ptr @llvm.frameaddress(i32 1)
57 %1 = tail call ptr @llvm.eh.recoverfp(ptr @main, ptr %0)
58 %2 = tail call ptr @llvm.localrecover(ptr @main, ptr %1, i32 0)
59 %3 = getelementptr inbounds i8, ptr %0, i32 -20
60 %4 = load ptr, ptr %3, align 4
61 %5 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 0
62 %6 = load ptr, ptr %5, align 4
63 %7 = load i32, ptr %6, align 4
64 store i32 %7, ptr %2, align 4
68 ; CHECK-LABEL: define internal i32 @"\01?filt$0@0@main@@"()
69 ; CHECK: tail call ptr @llvm.localrecover(ptr @main, ptr {{.*}}, i32 0)
71 define void @ScaleFilterCols_SSSE3(ptr %dst_ptr, ptr %src_ptr, i32 %dst_width, i32 %x, i32 %dx) sanitize_address {
73 %dst_width.addr = alloca i32, align 4
74 store i32 %dst_width, ptr %dst_width.addr, align 4
75 %0 = call { ptr, ptr, i32, i32, i32 } asm sideeffect "", "=r,=r,={ax},=r,=r,=*rm,rm,rm,0,1,2,3,4,5,~{memory},~{cc},~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) nonnull %dst_width.addr, i32 %x, i32 %dx, ptr %dst_ptr, ptr %src_ptr, i32 0, i32 0, i32 0, i32 %dst_width)
79 define void @ScaleColsUp2_SSE2() sanitize_address {