-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-add bitwise complement examples (now working)
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <stdint.h> | ||
|
||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void a() { ~0; } |