aboutsummaryrefslogtreecommitdiff
path: root/manual tests
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-07-30 09:21:53 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-08-18 14:47:38 -0400
commit1c403e20e70ac523216a31f977901fb815166b7a (patch)
tree97ea56fc22aa365acb931a7be8c0502890617661 /manual tests
parentadfee4460a6a01de975b25e6faf9fd9261238ebd (diff)
downloadmeson-1c403e20e70ac523216a31f977901fb815166b7a.zip
meson-1c403e20e70ac523216a31f977901fb815166b7a.tar.gz
meson-1c403e20e70ac523216a31f977901fb815166b7a.tar.bz2
Interpreter: Fix c_stdlib usage
- Exceptions raised during subproject setup were ignored. - Allow c_stdlib in native file, was already half supported. - Eliminate usage of subproject variable name by overriding '<lang>_stdlib' dependency name.
Diffstat (limited to 'manual tests')
-rw-r--r--manual tests/9 nostdlib/meson.build14
-rw-r--r--manual tests/9 nostdlib/prog.c7
-rw-r--r--manual tests/9 nostdlib/subprojects/mylibc/libc.c35
-rw-r--r--manual tests/9 nostdlib/subprojects/mylibc/meson.build11
-rw-r--r--manual tests/9 nostdlib/subprojects/mylibc/stdio.h5
-rw-r--r--manual tests/9 nostdlib/subprojects/mylibc/stubstart.s8
6 files changed, 0 insertions, 80 deletions
diff --git a/manual tests/9 nostdlib/meson.build b/manual tests/9 nostdlib/meson.build
deleted file mode 100644
index 9c5f949..0000000
--- a/manual tests/9 nostdlib/meson.build
+++ /dev/null
@@ -1,14 +0,0 @@
-project('own libc', 'c')
-
-# Not related to this test, but could not find a better place for this test.
-assert(meson.get_cross_property('nonexisting', 'defaultvalue') == 'defaultvalue',
- 'Cross prop getting is broken.')
-
-# A simple project that uses its own libc.
-
-# Note that we don't need to specify anything, the flags to use
-# stdlib come from the cross file.
-
-exe = executable('selfcontained', 'prog.c')
-
-test('standalone test', exe)
diff --git a/manual tests/9 nostdlib/prog.c b/manual tests/9 nostdlib/prog.c
deleted file mode 100644
index b9216ee..0000000
--- a/manual tests/9 nostdlib/prog.c
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include<stdio.h>
-
-int main(void) {
- const char *message = "Hello without stdlib.\n";
- return simple_print(message, simple_strlen(message));
-}
diff --git a/manual tests/9 nostdlib/subprojects/mylibc/libc.c b/manual tests/9 nostdlib/subprojects/mylibc/libc.c
deleted file mode 100644
index 67261cb..0000000
--- a/manual tests/9 nostdlib/subprojects/mylibc/libc.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Do not use this as the basis of your own libc.
- * The code is probably unoptimal or wonky, as I
- * had no prior experience with this, but instead
- * just fiddled with the code until it worked.
- */
-
-#include<stdio.h>
-
-#define STDOUT 1
-#define SYS_WRITE 4
-
-int simple_print(const char *msg, const long bufsize) {
- int count;
- long total_written = 0;
- while(total_written < bufsize) {
- asm(
- "int $0x80\n\t"
- : "=a"(count)
- : "0"(SYS_WRITE), "b"(STDOUT), "c"(msg+total_written), "d"(bufsize-total_written)
- :);
- if(count == 0) {
- return 1;
- }
- total_written += count;
- }
- return 0;
-}
-
-int simple_strlen(const char *str) {
- int len = 0;
- while(str[len] != '\0') {
- len++;
- }
- return len;
-}
diff --git a/manual tests/9 nostdlib/subprojects/mylibc/meson.build b/manual tests/9 nostdlib/subprojects/mylibc/meson.build
deleted file mode 100644
index aa0184e..0000000
--- a/manual tests/9 nostdlib/subprojects/mylibc/meson.build
+++ /dev/null
@@ -1,11 +0,0 @@
-project('own libc', 'c')
-
-# A very simple libc implementation
-
-# Do not specify -nostdlib & co. They come from cross specifications.
-
-libc = static_library('c', 'libc.c', 'stubstart.s')
-
-mylibc_dep = declare_dependency(link_with : libc,
- include_directories : include_directories('.')
-)
diff --git a/manual tests/9 nostdlib/subprojects/mylibc/stdio.h b/manual tests/9 nostdlib/subprojects/mylibc/stdio.h
deleted file mode 100644
index c3f8f56..0000000
--- a/manual tests/9 nostdlib/subprojects/mylibc/stdio.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-int simple_print(const char *msg, const long bufsize);
-
-int simple_strlen(const char *str);
diff --git a/manual tests/9 nostdlib/subprojects/mylibc/stubstart.s b/manual tests/9 nostdlib/subprojects/mylibc/stubstart.s
deleted file mode 100644
index 0a6d972..0000000
--- a/manual tests/9 nostdlib/subprojects/mylibc/stubstart.s
+++ /dev/null
@@ -1,8 +0,0 @@
-.globl _start
-
-_start:
-
- call main
- movl %eax, %ebx
- movl $1, %eax
- int $0x80