diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-02-01 07:19:38 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-02-01 07:19:38 +0000 |
commit | e18fc7bc2d947abc4ab6c07a0efbb6285ed404d2 (patch) | |
tree | 352b153164b57fcbc8d49f917ec2f900ca3aabee /test | |
parent | 69a0d80f55a0994ee857415bcc348d6d54c9ec1a (diff) | |
download | llvm-e18fc7bc2d947abc4ab6c07a0efbb6285ed404d2.tar.gz llvm-e18fc7bc2d947abc4ab6c07a0efbb6285ed404d2.tar.bz2 llvm-e18fc7bc2d947abc4ab6c07a0efbb6285ed404d2.tar.xz |
MC: Improve the .fill directive's compatibility with GAS
Per the GAS documentation, .fill should permit pattern widths that
aren't a power of two. While I was in the neighborhood, I added some
sanity checking. This change was motivated by a use of this construct
in the Linux Kernel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/MC/AsmParser/directive_fill.s | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/test/MC/AsmParser/directive_fill.s b/test/MC/AsmParser/directive_fill.s index bb3ced091c..11da32929f 100644 --- a/test/MC/AsmParser/directive_fill.s +++ b/test/MC/AsmParser/directive_fill.s @@ -1,4 +1,5 @@ -# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s +# RUN: llvm-mc -triple i386-unknown-unknown %s 2> %t.err | FileCheck %s +# RUN: FileCheck --check-prefix=CHECK-WARNINGS %s < %t.err # CHECK: TEST0: # CHECK: .byte 10 @@ -31,3 +32,43 @@ TEST3: # CHECK: .short 0 TEST4: .fill 4, 2 + +# CHECK: TEST5 +# CHECK: .short 2 +# CHECK: .byte 0 +# CHECK: .short 2 +# CHECK: .byte 0 +# CHECK: .short 2 +# CHECK: .byte 0 +# CHECK: .short 2 +# CHECK: .byte 0 +TEST5: + .fill 4, 3, 2 + +# CHECK: TEST6 +# CHECK: .long 2 +# CHECK: .long 0 +# CHECK-WARNINGS: '.fill' directive with size greater than 8 has been truncated to 8 +TEST6: + .fill 1, 9, 2 + +# CHECK: TEST7 +# CHECK: .long 0 +# CHECK: .long 0 +# CHECK-WARNINGS: '.fill' directive pattern has been truncated to 32-bits +TEST7: + .fill 1, 8, 1<<32 + +# CHECK-WARNINGS: '.fill' directive with negative repeat count has no effect +TEST8: + .fill -1, 8, 1 + +# CHECK-WARNINGS: '.fill' directive with negative size has no effect +TEST9: + .fill 1, -1, 1 + +# CHECK: TEST10 +# CHECK: .short 22136 +# CHECK: .byte 52 +TEST10: + .fill 1, 3, 0x12345678 |