| # REQUIRES: llvm-64-bits |
| # RUN: split-file %s %t |
| # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %t/chunk1.s -o %t/chunk1.o |
| # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %t/chunk2.s -o %t/chunk2.o |
| # --no-gc-sections to prevent the linker from optimizing the chunk away, otherwise it produces a tiny output |
| # RUN: not wasm-ld --no-entry --no-gc-sections %t/chunk1.o %t/chunk2.o -o %t/combined.wasm 2>&1 | FileCheck %s |
| # RUN: rm %t/chunk1.o %t/chunk2.o |
| |
| # Check that the linker fails gracefully when a section exceeds 4GB. |
| # CHECK: error: section '.debug_info' too large to encode: |
| |
| # Two chunks that together exceed 4GB |
| #--- chunk1.s |
| .section .debug_info,"",@ |
| .int32 0xAAAAAAAA |
| .zero 2147483640 |
| .int32 0xBBBBBBBB |
| |
| #--- chunk2.s |
| .section .debug_info,"",@ |
| .int32 0x11111111 |
| .zero 2147483640 |
| .int32 0x22222222 |