From 410d105a93776f5adec2e82f7245e4b3210dd9ce Mon Sep 17 00:00:00 2001 From: Dhruv Makwana Date: Tue, 23 Jul 2024 17:18:43 +0100 Subject: [PATCH] Re-add bitwise complement examples (now working) --- .../c-testsuite/working/00104.c | 29 +++++++++++++++++++ .../c-testsuite/working/00126.c | 21 ++++++++++++++ .../simple-examples/working/bit_compl_1.c | 1 + 3 files changed, 51 insertions(+) create mode 100644 src/example-archive/c-testsuite/working/00104.c create mode 100644 src/example-archive/c-testsuite/working/00126.c create mode 100644 src/example-archive/simple-examples/working/bit_compl_1.c diff --git a/src/example-archive/c-testsuite/working/00104.c b/src/example-archive/c-testsuite/working/00104.c new file mode 100644 index 00000000..f21cb997 --- /dev/null +++ b/src/example-archive/c-testsuite/working/00104.c @@ -0,0 +1,29 @@ +/* +internal error: todo: M_BW_COMPL +cn: internal error, uncaught exception: + Failure("internal error: todo: M_BW_COMPL") +*/ +// Cause: unknown + +#include + +int +main() +{ + int32_t x; + int64_t l; + + x = 0; + l = 0; + + x = ~x; + if (x != 0xffffffff) + return 1; + + l = ~l; + if (x != 0xffffffffffffffff) + return 2; + + + return 0; +} diff --git a/src/example-archive/c-testsuite/working/00126.c b/src/example-archive/c-testsuite/working/00126.c new file mode 100644 index 00000000..45ccb60a --- /dev/null +++ b/src/example-archive/c-testsuite/working/00126.c @@ -0,0 +1,21 @@ +/* +internal error: todo: M_BW_COMPL +cn: internal error, uncaught exception: + Failure("internal error: todo: M_BW_COMPL") +*/ +// Cause: unknown + +int +main() +{ + int x; + + x = 3; + x = !x; + x = !x; + x = ~x; + x = -x; + if(x != 2) + return 1; + return 0; +} diff --git a/src/example-archive/simple-examples/working/bit_compl_1.c b/src/example-archive/simple-examples/working/bit_compl_1.c new file mode 100644 index 00000000..0880e08b --- /dev/null +++ b/src/example-archive/simple-examples/working/bit_compl_1.c @@ -0,0 +1 @@ +void a() { ~0; }