Skip to content

Commit a6c0a9b

Browse files
committed
Add several tests to test printf of various configurations.
wasi-libc builds special versions of printf and other routines optimized for the case where long double and floating-point in general are not needed. Ensure that everything still compiles and runs.
1 parent 51abbf2 commit a6c0a9b

8 files changed

+36
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <stdio.h>
2+
3+
volatile long double x = 42.0L;
4+
5+
int main(void) {
6+
printf("the answer is %Lf\n", x);
7+
return 0;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <stdio.h>
2+
3+
volatile long double x = 42.0L;
4+
5+
int main(void) {
6+
printf("the answer is %Lf\n", x);
7+
return 0;
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-lc-printscan-long-double
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
the answer is 42.000000

tests/general/printf-no-float.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <stdio.h>
2+
3+
volatile int x = 42;
4+
5+
int main(void) {
6+
printf("the answer is %d\n", x);
7+
return 0;
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
the answer is 42
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <stdio.h>
2+
3+
volatile double x = 42.0;
4+
5+
int main(void) {
6+
printf("the answer is %f\n", x);
7+
return 0;
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
the answer is 42.000000

0 commit comments

Comments
 (0)