aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/063.sh
blob: 4f899eef4fea4af0d084f247dbd303659a42b9fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cat <<'EOF' > expected
123
456 789
EOF

test_diff <<'EOF'
#include <stdarg.h>

int fprintf();

struct FILE;
typedef struct FILE FILE;

extern FILE* stdout;

int vfprintf(FILE*, const char*, va_list);

void fatal_error(const char* msg, ...) {
    va_list args;
    va_start(args, msg);
    vfprintf(stdout, msg, args);
    va_end(args);
    fprintf(stdout, "\n");
}

int main() {
    fatal_error("%d", 123);
    fatal_error("%d %d", 456, 789);
    return 0;
}
EOF