diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-08-25 17:01:18 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-08-25 17:01:49 +0200 |
| commit | ba346ecfe9b8ee246e084183f34fa9ed941f9fa3 (patch) | |
| tree | 3b6df46875384f2d2aa441b8a57e25d100b18d4c | |
| parent | 4405188cf728755d41439e2606b2cba55af96ad9 (diff) | |
| download | zig-ba346ecfe9b8ee246e084183f34fa9ed941f9fa3.tar.gz zig-ba346ecfe9b8ee246e084183f34fa9ed941f9fa3.zip | |
run_translated_c: disable failing test on Windows
ziglang/zig#12630
| -rw-r--r-- | test/run_translated_c.zig | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/test/run_translated_c.zig b/test/run_translated_c.zig index 4345625dc1..1687e07f9c 100644 --- a/test/run_translated_c.zig +++ b/test/run_translated_c.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const builtin = @import("builtin"); const tests = @import("tests.zig"); const nl = std.cstr.line_sep; @@ -1683,38 +1684,41 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { // TODO: add isnan check for long double once bitfield support is added // (needed for x86_64-windows-gnu) // TODO: add isinf check for long double once std.math.isInf supports c_longdouble - cases.add("NAN and INFINITY", - \\#include <math.h> - \\#include <stdint.h> - \\#include <stdlib.h> - \\union uf { uint32_t u; float f; }; - \\#define CHECK_NAN(STR, VAL) { \ - \\ union uf unpack = {.f = __builtin_nanf(STR)}; \ - \\ if (!isnan(unpack.f)) abort(); \ - \\ if (unpack.u != VAL) abort(); \ - \\} - \\int main(void) { - \\ float f_nan = NAN; - \\ if (!isnan(f_nan)) abort(); - \\ double d_nan = NAN; - \\ if (!isnan(d_nan)) abort(); - \\ CHECK_NAN("0", 0x7FC00000); - \\ CHECK_NAN("", 0x7FC00000); - \\ CHECK_NAN("1", 0x7FC00001); - \\ CHECK_NAN("0x7FC00000", 0x7FC00000); - \\ CHECK_NAN("0x7FC0000F", 0x7FC0000F); - \\ CHECK_NAN("0x7FC000F0", 0x7FC000F0); - \\ CHECK_NAN("0x7FC00F00", 0x7FC00F00); - \\ CHECK_NAN("0x7FC0F000", 0x7FC0F000); - \\ CHECK_NAN("0x7FCF0000", 0x7FCF0000); - \\ CHECK_NAN("0xFFFFFFFF", 0x7FFFFFFF); - \\ float f_inf = INFINITY; - \\ if (!isinf(f_inf)) abort(); - \\ double d_inf = INFINITY; - \\ if (!isinf(d_inf)) abort(); - \\ return 0; - \\} - , ""); + // TODO https://github.com/ziglang/zig/issues/12630 + if (!(builtin.zig_backend == .stage2_llvm and builtin.target.os.tag == .windows)) { + cases.add("NAN and INFINITY", + \\#include <math.h> + \\#include <stdint.h> + \\#include <stdlib.h> + \\union uf { uint32_t u; float f; }; + \\#define CHECK_NAN(STR, VAL) { \ + \\ union uf unpack = {.f = __builtin_nanf(STR)}; \ + \\ if (!isnan(unpack.f)) abort(); \ + \\ if (unpack.u != VAL) abort(); \ + \\} + \\int main(void) { + \\ float f_nan = NAN; + \\ if (!isnan(f_nan)) abort(); + \\ double d_nan = NAN; + \\ if (!isnan(d_nan)) abort(); + \\ CHECK_NAN("0", 0x7FC00000); + \\ CHECK_NAN("", 0x7FC00000); + \\ CHECK_NAN("1", 0x7FC00001); + \\ CHECK_NAN("0x7FC00000", 0x7FC00000); + \\ CHECK_NAN("0x7FC0000F", 0x7FC0000F); + \\ CHECK_NAN("0x7FC000F0", 0x7FC000F0); + \\ CHECK_NAN("0x7FC00F00", 0x7FC00F00); + \\ CHECK_NAN("0x7FC0F000", 0x7FC0F000); + \\ CHECK_NAN("0x7FCF0000", 0x7FCF0000); + \\ CHECK_NAN("0xFFFFFFFF", 0x7FFFFFFF); + \\ float f_inf = INFINITY; + \\ if (!isinf(f_inf)) abort(); + \\ double d_inf = INFINITY; + \\ if (!isinf(d_inf)) abort(); + \\ return 0; + \\} + , ""); + } cases.add("signed array subscript. Issue #8556", \\#include <stdint.h> |
