blob: 82a61aabea4d9cbf01582c386686728fd4923f45 [file] [log] [blame]
Kostya Serebryany0c02d262014-04-16 12:12:19 +00001; Test asan internal compiler flags:
2; -asan-instrumentation-with-call-threshold
3; -asan-memory-access-callback-prefix
4
Arthur Eubanks7c2f2762020-07-17 17:49:46 -07005; 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 Serebryany0c02d262014-04-16 12:12:19 +000015target 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"
16target triple = "x86_64-unknown-linux-gnu"
17
Kostya Serebryanyc9a2c172014-04-22 11:19:45 +000018define void @test_load(i32* %a, i64* %b, i512* %c, i80* %d) sanitize_address {
Kostya Serebryany0c02d262014-04-16 12:12:19 +000019entry:
20; CHECK-CALL: call void @__asan_load4
21; CHECK-CALL: call void @__asan_load8
Kostya Serebryanyc9a2c172014-04-22 11:19:45 +000022; CHECK-CALL: call void @__asan_loadN{{.*}}i64 64)
23; CHECK-CALL: call void @__asan_loadN{{.*}}i64 10)
Kostya Serebryany0c02d262014-04-16 12:12:19 +000024; CHECK-CUSTOM-PREFIX: call void @__foo_load4
25; CHECK-CUSTOM-PREFIX: call void @__foo_load8
Kostya Serebryanyc9a2c172014-04-22 11:19:45 +000026; CHECK-CUSTOM-PREFIX: call void @__foo_loadN
Kostya Serebryany0c02d262014-04-16 12:12:19 +000027; CHECK-INLINE-NOT: call void @__asan_load
David Blaikiea79ac142015-02-27 21:17:42 +000028 %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 Serebryany0c02d262014-04-16 12:12:19 +000032 ret void
33}
34
35