| Index: tests_lit/asan_tests/func_ptr.ll
|
| diff --git a/tests_lit/asan_tests/func_ptr.ll b/tests_lit/asan_tests/func_ptr.ll
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..53d89b9b52f782ca7872f38857459435bf67ebca
|
| --- /dev/null
|
| +++ b/tests_lit/asan_tests/func_ptr.ll
|
| @@ -0,0 +1,25 @@
|
| +; Test that calls made through pointers are unchanged by ASan
|
| +
|
| +; REQUIRES: allow_dump
|
| +
|
| +; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \
|
| +; RUN: | FileCheck --check-prefix=DUMP %s
|
| +
|
| +define internal i32 @caller(i32 %callee_addr, i32 %arg) {
|
| + %callee = inttoptr i32 %callee_addr to i32 (i32)*
|
| + %result = call i32 %callee(i32 %arg)
|
| + ret i32 %result
|
| +}
|
| +
|
| +; DUMP-LABEL: ================ Initial CFG ================
|
| +; DUMP-NEXT: define internal i32 @caller(i32 %callee_addr, i32 %arg) {
|
| +; DUMP-NEXT: __0:
|
| +; DUMP-NEXT: %result = call i32 %callee_addr(i32 %arg)
|
| +; DUMP-NEXT: ret i32 %result
|
| +; DUMP-NEXT: }
|
| +; DUMP-LABEL: ================ Instrumented CFG ================
|
| +; DUMP-NEXT: define internal i32 @caller(i32 %callee_addr, i32 %arg) {
|
| +; DUMP-NEXT: __0:
|
| +; DUMP-NEXT: %result = call i32 %callee_addr(i32 %arg)
|
| +; DUMP-NEXT: ret i32 %result
|
| +; DUMP-NEXT: }
|
|
|