Index: tests_lit/asan_tests/startinitcall.ll |
diff --git a/tests_lit/asan_tests/startinitcall.ll b/tests_lit/asan_tests/startinitcall.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0e225d4d5703252c44d6ec167ac5709fccec5983 |
--- /dev/null |
+++ b/tests_lit/asan_tests/startinitcall.ll |
@@ -0,0 +1,27 @@ |
+; Test for a call to __asan_init in _start |
+ |
+; REQUIRES: allow_dump |
+ |
+; RUN: %p2i -i %s --args -verbose=inst -threads=0 -fsanitize-address \ |
+; RUN: | FileCheck --check-prefix=DUMP %s |
+ |
+; notStart() should not be instrumented |
+define internal void @notStart() { |
+ ret void |
+} |
+ |
+; DUMP-LABEL: ================ Instrumented CFG ================ |
+; DUMP-NEXT: define internal void @notStart( |
+; DUMP-NEXT: __0: |
+; DUMP-NOT: __asan_init() |
+; DUMP: } |
+ |
+; _start() should be instrumented |
+define void @_start() { |
+ ret void |
+} |
+ |
+; DUMP-LABEL: ================ Instrumented CFG ================ |
+; DUMP-NEXT: define void @_start( |
+; DUMP-NEXT: __0: |
+; DUMP-NEXT: call void @__asan_init() |