Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 1 | ; Test asan internal compiler flags: |
| 2 | ; -asan-instrumentation-with-call-threshold |
| 3 | ; -asan-memory-access-callback-prefix |
| 4 | |
Arthur Eubanks | 7c2f276 | 2020-07-17 17:49:46 -0700 | [diff] [blame] | 5 | ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-instrumentation-with-call-threshold=1 -S | FileCheck %s --check-prefix=CHECK-CALL |
| 6 | ; RUN: opt < %s -passes='asan-pipeline' -asan-instrumentation-with-call-threshold=1 -S | FileCheck %s --check-prefix=CHECK-CALL |
| 7 | ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s --check-prefix=CHECK-CALL |
| 8 | ; RUN: opt < %s -passes='asan-pipeline' -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s --check-prefix=CHECK-CALL |
| 9 | ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-instrumentation-with-call-threshold=0 -asan-memory-access-callback-prefix=__foo_ -S | FileCheck %s --check-prefix=CHECK-CUSTOM-PREFIX |
| 10 | ; RUN: opt < %s -passes='asan-pipeline' -asan-instrumentation-with-call-threshold=0 -asan-memory-access-callback-prefix=__foo_ -S | FileCheck %s --check-prefix=CHECK-CUSTOM-PREFIX |
| 11 | ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-instrumentation-with-call-threshold=5 -S | FileCheck %s --check-prefix=CHECK-INLINE |
| 12 | ; RUN: opt < %s -passes='asan-pipeline' -asan-instrumentation-with-call-threshold=5 -S | FileCheck %s --check-prefix=CHECK-INLINE |
| 13 | ; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK-INLINE |
| 14 | ; RUN: opt < %s -passes='asan-pipeline' -S | FileCheck %s --check-prefix=CHECK-INLINE |
Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 15 | target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" |
| 16 | target triple = "x86_64-unknown-linux-gnu" |
| 17 | |
Kostya Serebryany | c9a2c17 | 2014-04-22 11:19:45 +0000 | [diff] [blame] | 18 | define void @test_load(i32* %a, i64* %b, i512* %c, i80* %d) sanitize_address { |
Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 19 | entry: |
| 20 | ; CHECK-CALL: call void @__asan_load4 |
| 21 | ; CHECK-CALL: call void @__asan_load8 |
Kostya Serebryany | c9a2c17 | 2014-04-22 11:19:45 +0000 | [diff] [blame] | 22 | ; CHECK-CALL: call void @__asan_loadN{{.*}}i64 64) |
| 23 | ; CHECK-CALL: call void @__asan_loadN{{.*}}i64 10) |
Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 24 | ; CHECK-CUSTOM-PREFIX: call void @__foo_load4 |
| 25 | ; CHECK-CUSTOM-PREFIX: call void @__foo_load8 |
Kostya Serebryany | c9a2c17 | 2014-04-22 11:19:45 +0000 | [diff] [blame] | 26 | ; CHECK-CUSTOM-PREFIX: call void @__foo_loadN |
Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 27 | ; CHECK-INLINE-NOT: call void @__asan_load |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 28 | %tmp1 = load i32, i32* %a, align 4 |
| 29 | %tmp2 = load i64, i64* %b, align 8 |
| 30 | %tmp3 = load i512, i512* %c, align 32 |
| 31 | %tmp4 = load i80, i80* %d, align 8 |
Kostya Serebryany | 0c02d26 | 2014-04-16 12:12:19 +0000 | [diff] [blame] | 32 | ret void |
| 33 | } |
| 34 | |
| 35 | |