cosmopolitan/test/libc/release/smokecxx.cc
Justine Tunney 3ab76b2312 Fix cosmopolitan.h for C++
We now have an integration test that runs the amalgamated sources
through a C++ compiler, to prevent the recurrence of such issues.

Fixes #38
Thanks @gbbnfhb for the report!
2021-02-01 04:04:44 -08:00

11 lines
202 B
C++

int main() {
int rc;
FILE *f;
f = fopen("/dev/null", "w");
fprintf(f, "hello world\n");
fclose(f);
rc = system("exit 42");
CHECK_NE(-1, rc);
CHECK_EQ(42, WEXITSTATUS(rc));
return 0;
}