History

Herman proposed patch seems to fix clang issue on x64 Debian

Christian Jullien committed 6 years ago

Commit ffac4e71 parent 8cb3e531 file · +9 −3Browse files

Showing the changes to tests (1 of 1 file). Show all

Unified · Split

tests/tcctest.c+9−3
@@ -3225,9 +3225,17 @@ static __inline__ void sigdelset1(unsigned int *set, int _sig) · 3224 unmodified lines
32253225 asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags");
32263226 }
32273227
3228−#ifndef __APPLE__
3228+#ifdef __clang__
32293229 /* clang's inline asm is uncapable of 'xchgb %b0,%h0' */
32303230 static __inline__ __const__ unsigned int swab32(unsigned int x)
3231+{
3232+ return ((x >> 24) & 0xff) |
3233+ ((x >> 8) & 0xff00) |
3234+ ((x << 8) & 0xff0000) |
3235+ ((x << 24) & 0xff000000);
3236+}
3237+#else
3238+static __inline__ __const__ unsigned int swab32(unsigned int x)
32313239 {
32323240 __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
32333241 "rorl $16,%0\n\t" /* swap words */
@@ -3647,9 +3655,7 @@ void asm_test(void) · 413 unmodified lines
36473655 __asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");
36483656 printf("set=0x%x\n", set);
36493657 val = 0x01020304;
3650−#ifndef __APPLE__
36513658 printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));
3652−#endif
36533659 #ifndef _WIN32
36543660 #ifndef __APPLE__
36553661 override_func1();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t