Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / bad-fixup-expr.s
blob4dc9a5e1bf275dc04f58c364bd10e90f1dfb32ae
1 // RUN: not llvm-mc -filetype=obj -triple wasm32 %s -o /dev/null 2>&1 | FileCheck %s
3 .section .data.foo,"",@
4 foo:
5 .int8 1
6 .size foo, 1
7 foo_other:
8 .int8 1
9 .size foo_other, 1
11 .section .data.bar,"",@
12 bar:
13 .int8 1
14 .size bar, 1
16 .section .data.fizz,"",@
17 fizz:
18 .int8 1
19 .size fizz, 1
21 .section .data.segment1,"",@
22 segment1:
23 // CHECK: 'bar' can not be placed in a different section
24 .int32 fizz-bar
25 // CHECK: 'undef_baz' can not be undefined in a subtraction expression
26 .int32 fizz-undef_baz
27 // CHECK: 'fizz' can not be placed in a different section
28 .int32 undef_baz-fizz
29 .size segment1, 12
32 .text
33 .section .text.main,"",@
34 main:
35 .functype main () -> (i32, i32, i32, i32, i32)
36 // Expressions involving symbols within the same sections can be evaluated
37 // prior to writing the object file.
38 // CHECK-NOT: foo
39 i32.const foo-foo_other+2
40 i32.const foo_other-foo-10
42 // CHECK: 'bar' unsupported subtraction expression used in relocation in code section.
43 i32.const foo-bar
44 // CHECK: 'undef_baz' unsupported subtraction expression used in relocation in code section.
45 i32.const foo-undef_baz
46 // CHECK: 'foo' unsupported subtraction expression used in relocation in code section.
47 i32.const undef_baz-foo
48 end_function