55
66target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
77
8+ ;.
9+ ; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @tysan.module_ctor, ptr null }]
10+ ; CHECK: @__tysan_v1_Simple_20C_2b_2b_20TBAA = linkonce_odr constant { i64, i64, [16 x i8] } { i64 2, i64 0, [16 x i8] c"Simple C++ TBAA\00" }, comdat
11+ ; CHECK: @__tysan_v1_omnipotent_20char = linkonce_odr constant { i64, i64, ptr, i64, [16 x i8] } { i64 2, i64 1, ptr @__tysan_v1_Simple_20C_2b_2b_20TBAA, i64 0, [16 x i8] c"omnipotent char\00" }, comdat
12+ ; CHECK: @__tysan_v1_int = linkonce_odr constant { i64, i64, ptr, i64, [4 x i8] } { i64 2, i64 1, ptr @__tysan_v1_omnipotent_20char, i64 0, [4 x i8] c"int\00" }, comdat
13+ ; CHECK: @__tysan_v1_int_o_0 = linkonce_odr constant { i64, ptr, ptr, i64 } { i64 1, ptr @__tysan_v1_int, ptr @__tysan_v1_int, i64 0 }, comdat
14+ ; CHECK: @__tysan_shadow_memory_address = external global i64
15+ ; CHECK: @__tysan_app_memory_mask = external global i64
16+ ; CHECK: @__tysan_v1___ZTS1x = linkonce_odr constant { i64, i64, ptr, i64, ptr, i64, [7 x i8] } { i64 2, i64 2, ptr @__tysan_v1_int, i64 0, ptr @__tysan_v1_int, i64 4, [7 x i8] c"_ZTS1x\00" }, comdat
17+ ; CHECK: @__tysan_v1___ZTS1v = linkonce_odr constant { i64, i64, ptr, i64, ptr, i64, ptr, i64, [7 x i8] } { i64 2, i64 3, ptr @__tysan_v1_int, i64 8, ptr @__tysan_v1_int, i64 12, ptr @__tysan_v1___ZTS1x, i64 16, [7 x i8] c"_ZTS1v\00" }, comdat
18+ ; CHECK: @__tysan_v1___ZTS1v_o_12 = linkonce_odr constant { i64, ptr, ptr, i64 } { i64 1, ptr @__tysan_v1___ZTS1v, ptr @__tysan_v1_int, i64 12 }, comdat
19+ ; CHECK: @llvm.used = appending global [8 x ptr] [ptr @tysan.module_ctor, ptr @__tysan_v1_Simple_20C_2b_2b_20TBAA, ptr @__tysan_v1_omnipotent_20char, ptr @__tysan_v1_int, ptr @__tysan_v1_int_o_0, ptr @__tysan_v1___ZTS1x, ptr @__tysan_v1___ZTS1v, ptr @__tysan_v1___ZTS1v_o_12], section "llvm.metadata"
20+ ;.
821define i32 @test_load (ptr %a ) sanitize_type {
922; CHECK-LABEL: @test_load(
1023; CHECK-NEXT: entry:
11- ; CHECK-NEXT: %app.mem.mask = load i64, ptr @__tysan_app_memory_mask, align 8
12- ; CHECK-NEXT: %shadow.base = load i64, ptr @__tysan_shadow_memory_address, align 8
13- ; CHECK-NEXT: call void @__tysan_instrument_with_shadow_update(ptr %a, ptr @__tysan_v1_int_o_0, i1 true, i64 4, i32 1)
14- ; CHECK-NEXT: %tmp1 = load i32, ptr %a, align 4, !tbaa !0
15- ; CHECK-NEXT: ret i32 %tmp1
24+ ; CHECK-NEXT: [[APP_MEM_MASK:%.*]] = load i64, ptr @__tysan_app_memory_mask, align 8
25+ ; CHECK-NEXT: [[SHADOW_BASE:%.*]] = load i64, ptr @__tysan_shadow_memory_address, align 8
26+ ; CHECK-NEXT: call void @__tysan_instrument_with_shadow_update(ptr [[A:%.*]], ptr @__tysan_v1_int_o_0, i1 true, i64 4, i32 1)
27+ ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[A]], align 4, !tbaa [[TBAA0:![0-9]+]]
28+ ; CHECK-NEXT: ret i32 [[TMP1]]
29+ ;
1630entry:
1731 %tmp1 = load i32 , ptr %a , align 4 , !tbaa !3
1832 ret i32 %tmp1
@@ -21,11 +35,12 @@ entry:
2135define void @test_store (ptr %a ) sanitize_type {
2236; CHECK-LABEL: @test_store(
2337; CHECK-NEXT: entry:
24- ; CHECK-NEXT: %app.mem.mask = load i64, ptr @__tysan_app_memory_mask, align 8
25- ; CHECK-NEXT: %shadow.base = load i64, ptr @__tysan_shadow_memory_address, align 8
26- ; CHECK-NEXT: call void @__tysan_instrument_with_shadow_update(ptr %a , ptr @__tysan_v1___ZTS1v_o_12, i1 true, i64 4, i32 2)
27- ; CHECK-NEXT: store i32 42, ptr %a , align 4, !tbaa !4
38+ ; CHECK-NEXT: [[APP_MEM_MASK:%.*]] = load i64, ptr @__tysan_app_memory_mask, align 8
39+ ; CHECK-NEXT: [[SHADOW_BASE:%.*]] = load i64, ptr @__tysan_shadow_memory_address, align 8
40+ ; CHECK-NEXT: call void @__tysan_instrument_with_shadow_update(ptr [[A:%.*]] , ptr @__tysan_v1___ZTS1v_o_12, i1 true, i64 4, i32 2)
41+ ; CHECK-NEXT: store i32 42, ptr [[A]] , align 4, !tbaa [[TBAA4:![0-9]+]]
2842; CHECK-NEXT: ret void
43+ ;
2944
3045entry:
3146 store i32 42 , ptr %a , align 4 , !tbaa !6
@@ -39,3 +54,15 @@ entry:
3954!4 = !{!"_ZTS1x" , !2 , i64 0 , !2 , i64 4 }
4055!5 = !{!"_ZTS1v" , !2 , i64 8 , !2 , i64 12 , !4 , i64 16 }
4156!6 = !{!5 , !2 , i64 12 }
57+ ;.
58+ ; CHECK: attributes #[[ATTR0:[0-9]+]] = { sanitize_type }
59+ ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nounwind }
60+ ;.
61+ ; CHECK: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
62+ ; CHECK: [[META1]] = !{!"int", [[META2:![0-9]+]], i64 0}
63+ ; CHECK: [[META2]] = !{!"omnipotent char", [[META3:![0-9]+]], i64 0}
64+ ; CHECK: [[META3]] = !{!"Simple C++ TBAA"}
65+ ; CHECK: [[TBAA4]] = !{[[META5:![0-9]+]], [[META1]], i64 12}
66+ ; CHECK: [[META5]] = !{!"_ZTS1v", [[META1]], i64 8, [[META1]], i64 12, [[META6:![0-9]+]], i64 16}
67+ ; CHECK: [[META6]] = !{!"_ZTS1x", [[META1]], i64 0, [[META1]], i64 4}
68+ ;.
0 commit comments