glsl: Fixes glcpp/tests with mingw/gcc

glcpp mingw failing in the following way:
```
49/56 mesa:compiler+glcpp / glcpp test (unix)     FAIL             3.39s   exit status 1
50/56 mesa:compiler+glcpp / glcpp test (oldmac)   FAIL             3.41s   exit status 1
51/56 mesa:compiler+glcpp / glcpp test (bizarro)  FAIL             3.42s   exit status 1
52/56 mesa:compiler+glcpp / glcpp test (windows)  FAIL             3.45s   exit status 1
```

The test failed because on mingw, the stderr will comes after stdout,
but all the expect files, the stderr is coming first,
so we flush(stderr) first to makesure stderr out before stdout

The failing example:

039-func-arg-obj-macro-with-comma: FAIL
---

+++

@@ -1,3 +1,5 @@

+0:12(21): preprocessor error: Error: macro foo invoked with 2 arguments (expected 1)
+

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26778>
This commit is contained in:
Yonggang Luo 2023-12-15 23:08:12 +08:00 committed by Marge Bot
parent ae54cbeb3f
commit aa8ea0f1b9

View file

@ -174,8 +174,10 @@ main (int argc, char *argv[])
ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, NULL, &gl_ctx);
printf("%s", shader);
fprintf(stderr, "%s", info_log);
fflush(stderr);
printf("%s", shader);
fflush(stdout);
ralloc_free(ctx);