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( |
Karl
2016/06/15 14:19:28
Wouldn't be safer to make this the DUMP-LABEL entr
tlively
2016/06/15 16:32:00
Done.
|
+; 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( |
Karl
2016/06/15 14:19:28
Same here.
tlively
2016/06/15 16:32:00
Done.
|
+; DUMP-NEXT: __0: |
+; DUMP-NEXT: call void @__asan_init() |