aboutsummaryrefslogtreecommitdiff
path: root/test/Instrumentation/AddressSanitizer/basic.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-07-16 08:58:53 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-07-16 08:58:53 +0000
commitc3c8db9d25e69083cec0c2d4a01735cd9e01269f (patch)
tree5f677cfa1b6471bb519bd1517ac8f78ece4a7184 /test/Instrumentation/AddressSanitizer/basic.ll
parent2f58533d1ec551878b770f8812474b836c32fd6e (diff)
Teach AddressSanitizer to create basic blocks in a more natural order.
This is particularly useful to the backend code generators which try to process things in the incoming function order. Also, cleanup some uses of IRBuilder to be a bit simpler and more clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation/AddressSanitizer/basic.ll')
-rw-r--r--test/Instrumentation/AddressSanitizer/basic.ll22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/Instrumentation/AddressSanitizer/basic.ll b/test/Instrumentation/AddressSanitizer/basic.ll
index e80cfeef12..15b51d410a 100644
--- a/test/Instrumentation/AddressSanitizer/basic.ll
+++ b/test/Instrumentation/AddressSanitizer/basic.ll
@@ -16,11 +16,6 @@ define i32 @test_load(i32* %a) address_safety {
; CHECK: icmp ne i8
; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
;
-; The actual load comes next because ASan adds the last instrumentation block
-; to the end of the function.
-; CHECK: %tmp1 = load i32* %a
-; CHECK: ret i32 %tmp1
-;
; First instrumentation block refines the shadow test.
; CHECK: and i64 %[[LOAD_ADDR]], 7
; CHECK: add i64 %{{.*}}, 3
@@ -28,9 +23,13 @@ define i32 @test_load(i32* %a) address_safety {
; CHECK: icmp sge i8 %{{.*}}, %[[LOAD_SHADOW]]
; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
;
-; Final instrumentation block reports the error.
+; Second instrumentation block reports the error.
; CHECK: call void @__asan_report_load4(i64 %[[LOAD_ADDR]]) noreturn
; CHECK: unreachable
+;
+; Finally the instrumented load.
+; CHECK: %tmp1 = load i32* %a
+; CHECK: ret i32 %tmp1
entry:
%tmp1 = load i32* %a
@@ -48,11 +47,6 @@ define void @test_store(i32* %a) address_safety {
; CHECK: icmp ne i8
; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
;
-; The actual store comes next because ASan adds the last instrumentation block
-; to the end of the function.
-; CHECK: store i32 42, i32* %a
-; CHECK: ret void
-;
; First instrumentation block refines the shadow test.
; CHECK: and i64 %[[STORE_ADDR]], 7
; CHECK: add i64 %{{.*}}, 3
@@ -60,9 +54,13 @@ define void @test_store(i32* %a) address_safety {
; CHECK: icmp sge i8 %{{.*}}, %[[STORE_SHADOW]]
; CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
;
-; Final instrumentation block reports the error.
+; Second instrumentation block reports the error.
; CHECK: call void @__asan_report_store4(i64 %[[STORE_ADDR]]) noreturn
; CHECK: unreachable
+;
+; Finally the instrumented store.
+; CHECK: store i32 42, i32* %a
+; CHECK: ret void
entry:
store i32 42, i32* %a