summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2017-05-15 08:43:27 +0000
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2017-05-15 08:43:27 +0000
commit6d2417924c42e061d2812de90751d301a0a20740 (patch)
treec3edc9a34996bf41a17492f4de73e9979c927d85 /llvm/test
parent0fe7231a2ffd2df77ea056ac4a58ae48cff08b26 (diff)
downloadbcm5719-llvm-6d2417924c42e061d2812de90751d301a0a20740.tar.gz
bcm5719-llvm-6d2417924c42e061d2812de90751d301a0a20740.zip
MCObjectStreamer : fail with a diagnostic when emitting an out of range value.
We were previously silently emitting bogus data in release mode, making it very hard to diagnose the error, or crashing with an assert in debug mode. A proper diagnostic is now always emitted when the value to be emitted is out of range. llvm-svn: 303041
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/AArch64/label-arithmetic-diags-elf.s9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/MC/AArch64/label-arithmetic-diags-elf.s b/llvm/test/MC/AArch64/label-arithmetic-diags-elf.s
index e9d92d591fa..dbfdd24f8dc 100644
--- a/llvm/test/MC/AArch64/label-arithmetic-diags-elf.s
+++ b/llvm/test/MC/AArch64/label-arithmetic-diags-elf.s
@@ -1,5 +1,14 @@
// RUN: not llvm-mc -triple aarch64-elf -filetype=obj %s -o /dev/null 2>&1 | FileCheck %s
+ .data
+b:
+ .fill 300
+e:
+ .byte e - b
+ // CHECK: error: value evaluated as 300 is out of range.
+ // CHECK-NEXT: .byte e - b
+ // CHECK-NEXT: ^
+
.section sec_x
start:
.space 5000
OpenPOWER on IntegriCloud