Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 1 | ; Test for a call to __asan_check() preceding stores |
| 2 | |
| 3 | ; REQUIRES: allow_dump |
| 4 | |
| 5 | ; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \ |
| 6 | ; RUN: | FileCheck --check-prefix=DUMP %s |
| 7 | |
Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 8 | ; A function with a local variable that does the stores |
Thomas Lively | ac27c51 | 2016-07-26 11:47:40 -0700 | [diff] [blame] | 9 | define internal void @doStores(<4 x i32> %vecSrc, i32 %arg8, i32 %arg16, |
| 10 | i32 %arg32, i32 %arg64, i32 %arg128) { |
| 11 | %destLocal8 = inttoptr i32 %arg8 to i8* |
| 12 | %destLocal16 = inttoptr i32 %arg16 to i16* |
| 13 | %destLocal32 = inttoptr i32 %arg32 to i32* |
| 14 | %destLocal64 = inttoptr i32 %arg64 to i64* |
| 15 | %destLocal128 = inttoptr i32 %arg128 to <4 x i32>* |
Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 16 | |
Thomas Lively | ac27c51 | 2016-07-26 11:47:40 -0700 | [diff] [blame] | 17 | store i8 42, i8* %destLocal8, align 1 |
| 18 | store i16 42, i16* %destLocal16, align 1 |
| 19 | store i32 42, i32* %destLocal32, align 1 |
| 20 | store i64 42, i64* %destLocal64, align 1 |
| 21 | store <4 x i32> %vecSrc, <4 x i32>* %destLocal128, align 4 |
Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 22 | |
| 23 | ret void |
| 24 | } |
| 25 | |
| 26 | ; DUMP-LABEL: ================ Instrumented CFG ================ |
Thomas Lively | ac27c51 | 2016-07-26 11:47:40 -0700 | [diff] [blame] | 27 | ; DUMP-NEXT: define internal void @doStores( |
Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 28 | ; DUMP-NEXT: __0: |
Thomas Lively | ac27c51 | 2016-07-26 11:47:40 -0700 | [diff] [blame] | 29 | ; DUMP-NEXT: call void @__asan_check_store(i32 %arg8, i32 1) |
| 30 | ; DUMP-NEXT: store i8 42, i8* %arg8, align 1 |
| 31 | ; DUMP-NEXT: call void @__asan_check_store(i32 %arg16, i32 2) |
| 32 | ; DUMP-NEXT: store i16 42, i16* %arg16, align 1 |
| 33 | ; DUMP-NEXT: call void @__asan_check_store(i32 %arg32, i32 4) |
| 34 | ; DUMP-NEXT: store i32 42, i32* %arg32, align 1 |
| 35 | ; DUMP-NEXT: call void @__asan_check_store(i32 %arg64, i32 8) |
| 36 | ; DUMP-NEXT: store i64 42, i64* %arg64, align 1 |
| 37 | ; DUMP-NEXT: call void @__asan_check_store(i32 %arg128, i32 16) |
| 38 | ; DUMP-NEXT: store <4 x i32> %vecSrc, <4 x i32>* %arg128, align 4 |
Thomas Lively | 1fd80c7 | 2016-06-27 14:47:21 -0700 | [diff] [blame] | 39 | ; DUMP: ret void |
Thomas Lively | bdb912f | 2016-06-16 11:03:15 -0700 | [diff] [blame] | 40 | ; DUMP-NEXT: } |