memory-ignored-dot-assign.test 528 Bytes
# REQUIRES: x86
# RUN: echo 'nop; .data; nop' | llvm-mc -filetype=obj -triple=x86_64 - -o %t.o
# RUN: ld.lld -o %t.so --script %s %t.o
# RUN: llvm-readelf -S %t.so | FileCheck %s

# CHECK:      [ 1] .text PROGBITS 0000000000042000 001000 000001
# CHECK-NEXT: [ 2] .data PROGBITS 0000000000042001 001001 000001

## Test that assigning to Dot does not change the position in a memory region.

MEMORY {
  ram (wxa) : ORIGIN = 0x42000, LENGTH = 0x100000
}
SECTIONS {
  .text : { *(.text*) }
  . += 0x2000;
  .data : { *(.data*) }
}