diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-12-09 00:21:41 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-12-09 00:21:41 +0000 |
| commit | c667c1f47a8ec1acfd6eceb999f8f05793218ca1 (patch) | |
| tree | 90e81b64ba0ee0c00b7339818de00ac1cd486026 /llvm/test/Transforms/Inline | |
| parent | 8bd9d6ad838dd6a030f4cfcf691fb54162976e48 (diff) | |
| download | bcm5719-llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.tar.gz bcm5719-llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.zip | |
Hardware-assisted AddressSanitizer (llvm part).
Summary:
This is LLVM instrumentation for the new HWASan tool. It is basically
a stripped down copy of ASan at this point, w/o stack or global
support. Instrumenation adds a global constructor + runtime callbacks
for every load and store.
HWASan comes with its own IR attribute.
A brief design document can be found in
clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier).
Reviewers: kcc, pcc, alekseyshl
Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D40932
llvm-svn: 320217
Diffstat (limited to 'llvm/test/Transforms/Inline')
| -rw-r--r-- | llvm/test/Transforms/Inline/attributes.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/attributes.ll b/llvm/test/Transforms/Inline/attributes.ll index 1cc64b78432..0df3cfa9a52 100644 --- a/llvm/test/Transforms/Inline/attributes.ll +++ b/llvm/test/Transforms/Inline/attributes.ll @@ -10,6 +10,10 @@ define i32 @sanitize_address_callee(i32 %i) sanitize_address { ret i32 %i } +define i32 @sanitize_hwaddress_callee(i32 %i) sanitize_hwaddress { + ret i32 %i +} + define i32 @sanitize_thread_callee(i32 %i) sanitize_thread { ret i32 %i } @@ -30,6 +34,10 @@ define i32 @alwaysinline_sanitize_address_callee(i32 %i) alwaysinline sanitize_a ret i32 %i } +define i32 @alwaysinline_sanitize_hwaddress_callee(i32 %i) alwaysinline sanitize_hwaddress { + ret i32 %i +} + define i32 @alwaysinline_sanitize_thread_callee(i32 %i) alwaysinline sanitize_thread { ret i32 %i } @@ -59,6 +67,17 @@ define i32 @test_no_sanitize_address(i32 %arg) { ; CHECK-NEXT: ret i32 } +define i32 @test_no_sanitize_hwaddress(i32 %arg) { + %x1 = call i32 @noattr_callee(i32 %arg) + %x2 = call i32 @sanitize_hwaddress_callee(i32 %x1) + %x3 = call i32 @alwaysinline_callee(i32 %x2) + %x4 = call i32 @alwaysinline_sanitize_hwaddress_callee(i32 %x3) + ret i32 %x4 +; CHECK-LABEL: @test_no_sanitize_hwaddress( +; CHECK-NEXT: @sanitize_hwaddress_callee +; CHECK-NEXT: ret i32 +} + define i32 @test_no_sanitize_memory(i32 %arg) { %x1 = call i32 @noattr_callee(i32 %arg) %x2 = call i32 @sanitize_memory_callee(i32 %x1) @@ -98,6 +117,17 @@ define i32 @test_sanitize_address(i32 %arg) sanitize_address { ; CHECK-NEXT: ret i32 } +define i32 @test_sanitize_hwaddress(i32 %arg) sanitize_hwaddress { + %x1 = call i32 @noattr_callee(i32 %arg) + %x2 = call i32 @sanitize_hwaddress_callee(i32 %x1) + %x3 = call i32 @alwaysinline_callee(i32 %x2) + %x4 = call i32 @alwaysinline_sanitize_hwaddress_callee(i32 %x3) + ret i32 %x4 +; CHECK-LABEL: @test_sanitize_hwaddress( +; CHECK-NEXT: @noattr_callee +; CHECK-NEXT: ret i32 +} + define i32 @test_sanitize_memory(i32 %arg) sanitize_memory { %x1 = call i32 @noattr_callee(i32 %arg) %x2 = call i32 @sanitize_memory_callee(i32 %x1) |

