MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / main

Function main

test/core/test_varargs.c:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85GETMAX(D, double);
86
87int main(int argc, char **argv) {
88 vary("*cheez: %d+%d*", 0,
89 24); // Also tests that '0' is not special as an array ender
90 vary("*albeit*"); // Should not fail with no var args in vararg function
91 vary2('Q', "%d*", 85);
92
93 int maxxi = getMaxi(6, 2, 5, 21, 4, -10, 19);
94 printf("maxxi:%d*\n", maxxi);
95 double maxxD = getMaxD(6, (double)2.1, (double)5.1, (double)22.1, (double)4.1,
96 (double)-10.1, (double)19.1, (double)2);
97 printf("maxxD:%.2f*\n", (float)maxxD);
98
99 // And, as a function pointer
100 void (*vfp)(const char * s, ...) = argc == 1211 ? NULL : vary;
101 vfp("*vfp:%d,%d*", 22, 199);
102
103 // ensure lists work properly when copied, reinited etc.
104 varargs_listoffsets_main();
105
106 return 0;
107}

Callers

nothing calls this directly

Calls 4

vary2Function · 0.85
printfFunction · 0.85
varargs_listoffsets_mainFunction · 0.85
varyFunction · 0.70

Tested by

no test coverage detected