summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/output_tests/large_func_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/asan/output_tests/large_func_test.cc')
-rw-r--r--compiler-rt/lib/asan/output_tests/large_func_test.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/output_tests/large_func_test.cc b/compiler-rt/lib/asan/output_tests/large_func_test.cc
new file mode 100644
index 00000000000..70bc36f40b8
--- /dev/null
+++ b/compiler-rt/lib/asan/output_tests/large_func_test.cc
@@ -0,0 +1,33 @@
+#include <stdlib.h>
+__attribute__((noinline))
+static void LargeFunction(int *x, int zero) {
+ x[0]++;
+ x[1]++;
+ x[2]++;
+ x[3]++;
+ x[4]++;
+ x[5]++;
+ x[6]++;
+ x[7]++;
+ x[8]++;
+ x[9]++;
+
+ x[zero + 111]++; // we should report this exact line
+
+ x[10]++;
+ x[11]++;
+ x[12]++;
+ x[13]++;
+ x[14]++;
+ x[15]++;
+ x[16]++;
+ x[17]++;
+ x[18]++;
+ x[19]++;
+}
+
+int main(int argc, char **argv) {
+ int *x = new int[100];
+ LargeFunction(x, argc - 1);
+ delete x;
+}
OpenPOWER on IntegriCloud