Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / scanf.c
bloba7f35c2af57eea01507f79c569d536773d389bbb
1 // RUN: %clang -std=c17 %s -o %t && %run %t
2 /// Test __isoc23_* for glibc 2.38+.
3 // RUN: %clang -std=c23 %s -o %t && %run %t
5 #include <assert.h>
6 #include <stdarg.h>
7 #include <stdio.h>
9 int test_vsscanf(const char *buf, const char *fmt, ...) {
10 va_list ap;
11 va_start(ap, fmt);
12 int ret = vsscanf(buf, fmt, ap);
13 va_end(ap);
14 return ret;
17 int main(int argc, char **argv) {
18 int x, y;
19 assert(sscanf("42", "%d", &x) == 1);
20 assert(x == 42);
21 assert(test_vsscanf("42", "%d", &y) == 1);
22 assert(y == 42);
23 return 0;