Test which flags make our asm compile.
Previously we relied on assumption that clang always needs -no-integrated-as but it's not always true.
This commit is contained in:
parent
0b02bfa034
commit
065ad910f1
6 changed files with 89 additions and 27 deletions
20
asm-tests/arm.S
Normal file
20
asm-tests/arm.S
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* on arm clang doesn't support .arch directive */
|
||||
|
||||
.text
|
||||
.syntax unified
|
||||
|
||||
#if !defined (__thumb2__)
|
||||
.arch armv7a
|
||||
.arm
|
||||
#else
|
||||
.arch armv7
|
||||
.thumb
|
||||
#endif
|
||||
mcr p15, 0, r11, c7, c14, 2
|
||||
|
||||
/* clang restricts access to dsb/isb despite .arch */
|
||||
dsb
|
||||
isb
|
||||
|
||||
|
||||
|
10
asm-tests/i386.S
Normal file
10
asm-tests/i386.S
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* on x86 old clang doesn't support .code16
|
||||
newer clang supports it but creates 6-byte jumps instead of 3-byte ones
|
||||
which makes us go over boot sector size. */
|
||||
|
||||
.code16
|
||||
jmp far
|
||||
.org 4
|
||||
.space 300
|
||||
far:
|
||||
.byte 0
|
11
asm-tests/mips.S
Normal file
11
asm-tests/mips.S
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* on mips clang doesn't support privilegied instructions, doubleword store/load
|
||||
and crashes with hand-written assembly
|
||||
*/
|
||||
|
||||
.set mips3
|
||||
sync
|
||||
ld $t2, 0($t6)
|
||||
|
||||
a:
|
||||
addiu $t7, $s0, (b - a)
|
||||
b: nop
|
8
asm-tests/powerpc.S
Normal file
8
asm-tests/powerpc.S
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly
|
||||
used by gcrypt */
|
||||
/* Cache invalidation loop is a fair test. */
|
||||
li 5, 0
|
||||
1: icbi 5, 3
|
||||
addi 5, 5, 32
|
||||
cmpw 5, 4
|
||||
blt 1b
|
9
asm-tests/sparc64.S
Normal file
9
asm-tests/sparc64.S
Normal file
|
@ -0,0 +1,9 @@
|
|||
.text
|
||||
1:
|
||||
/* A small list of examples of what clang doesn't support. */
|
||||
clr %o0
|
||||
lduw [%o4 + 4], %o4
|
||||
and %o6, ~0xff, %o6
|
||||
stw %o5, [%o3]
|
||||
bne,pt %icc, 1b
|
||||
nop
|
Loading…
Add table
Add a link
Reference in a new issue