forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7c2396
commit 8c001b1
Showing
1 changed file
with
32 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,32 @@ | ||
|
||
|
||
typedef unsigned int uint; | ||
typedef signed char schar; | ||
typedef unsigned char uchar; | ||
|
||
|
||
#define DS(type) \ | ||
volatile int s1_##type; \ | ||
volatile type s2_##type; \ | ||
volatile type s3_##type; \ | ||
volatile type s4_##type; \ | ||
__attribute__((noinline)) \ | ||
void do_shifts_##type(type a, type b){ \ | ||
s1_##type = a << 3; \ | ||
s2_##type = b << 15; \ | ||
s3_##type = a >> 4; \ | ||
s4_##type = b >> 14; \ | ||
} | ||
|
||
|
||
DS(int) | ||
DS(uint) | ||
DS(schar) | ||
DS(uchar) | ||
|
||
int main(){ | ||
do_shifts_int(-228, -1337); | ||
do_shifts_uint(228, 1337); | ||
do_shifts_schar(-57, -99); | ||
do_shifts_uchar(211, 122); | ||
} |