aboutsummaryrefslogtreecommitdiff
path: root/debug/programs
diff options
context:
space:
mode:
authorcgsfv <cgsfv@users.noreply.github.com>2018-10-03 15:58:00 +0200
committercgsfv <cgsfv@users.noreply.github.com>2018-10-03 15:58:00 +0200
commit6ac2c6350757a07b4469f37eca61bf44854f41c6 (patch)
tree107a96665449b128e280cc9f0ae0ea8c75b7e4c4 /debug/programs
parentfbd7e037ec947c6e9dddc9b78c1cd6bc0fce9993 (diff)
downloadriscv-tests-6ac2c6350757a07b4469f37eca61bf44854f41c6.zip
riscv-tests-6ac2c6350757a07b4469f37eca61bf44854f41c6.tar.gz
riscv-tests-6ac2c6350757a07b4469f37eca61bf44854f41c6.tar.bz2
Added tests for hw and sw watchpoints
Diffstat (limited to 'debug/programs')
-rw-r--r--debug/programs/counting_loop.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/debug/programs/counting_loop.c b/debug/programs/counting_loop.c
new file mode 100644
index 0000000..2116e52
--- /dev/null
+++ b/debug/programs/counting_loop.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+int main()
+{
+ int sum = 0;
+ int counter = 0;
+
+ while (counter < 10) {
+ counter = counter + 1;
+ sum = sum + counter;
+ }
+
+ return counter;
+}