[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/test/misc/stdarg.c b/ap/build/uClibc/test/misc/stdarg.c
new file mode 100644
index 0000000..1566e0c
--- /dev/null
+++ b/ap/build/uClibc/test/misc/stdarg.c
@@ -0,0 +1,23 @@
+/* copied from rsync */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <stdarg.h>
+static int foo(const char *format, ...)
+{
+ va_list ap;
+ size_t len;
+ char buf[5];
+
+ va_start(ap, format);
+ len = vsnprintf(0, 0, format, ap);
+ va_end(ap);
+ if (len != 5) return(1);
+
+ if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) return(1);
+
+ return(0);
+}
+int main(void) { return foo("hello"); }