summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/Makefile22
-rw-r--r--tests/src/data256mb.c2
-rw-r--r--tests/src/puts_alternative.c10
-rw-r--r--tests/src/puts_noarg.c7
-rw-r--r--tests/src/putsmain.c9
-rw-r--r--tests/src/putsmainsub.c13
6 files changed, 63 insertions, 0 deletions
diff --git a/tests/src/Makefile b/tests/src/Makefile
new file mode 100644
index 0000000..1a2b177
--- /dev/null
+++ b/tests/src/Makefile
@@ -0,0 +1,22 @@
+CFLAGS := -Wall -pedantic
+EXES := putsmain putsmainsub brkmain
+OBJS := puts_noarg.o puts_alternative.o puts_data.o
+TARGETS := $(EXES) $(OBJS)
+
+
+all: $(TARGETS)
+
+
+putsmain: putsmain.c
+ gcc $(CFLAGS) $^ -o $@
+
+putsmainsub: putsmainsub.c
+ gcc $(CFLAGS) $^ -o $@
+
+.c.o:
+ gcc $(CFLAGS) -c $< -o $@
+
+
+.PHONY: clean
+clean:
+ rm -f $(TARGETS)
diff --git a/tests/src/data256mb.c b/tests/src/data256mb.c
new file mode 100644
index 0000000..2cd3849
--- /dev/null
+++ b/tests/src/data256mb.c
@@ -0,0 +1,2 @@
+/* 256 MB worth of data. */
+char data256mb[256*1024*1024] = {1};
diff --git a/tests/src/puts_alternative.c b/tests/src/puts_alternative.c
new file mode 100644
index 0000000..21d65cb
--- /dev/null
+++ b/tests/src/puts_alternative.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+void puts_alternative(char *arg)
+{
+ puts("puts_alternative() has been reached.");
+
+ puts(arg);
+
+ puts("puts_alternative() is returning.");
+}
diff --git a/tests/src/puts_noarg.c b/tests/src/puts_noarg.c
new file mode 100644
index 0000000..fe7d494
--- /dev/null
+++ b/tests/src/puts_noarg.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void puts_noarg()
+{
+ puts("puts_noarg() has been reached.");
+ puts("puts_noarg() is returning.");
+}
diff --git a/tests/src/putsmain.c b/tests/src/putsmain.c
new file mode 100644
index 0000000..9b2ce3c
--- /dev/null
+++ b/tests/src/putsmain.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main()
+{
+ puts("puts() #1 called in main()");
+ puts("puts() #2 called in main()");
+
+ return 0;
+}
diff --git a/tests/src/putsmainsub.c b/tests/src/putsmainsub.c
new file mode 100644
index 0000000..63d4171
--- /dev/null
+++ b/tests/src/putsmainsub.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+void sub()
+{
+ puts("sub() called.");
+}
+
+int main()
+{
+ sub();
+
+ return 0;
+}