1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t.o
3# RUN: ld.lld -o %t.so --script %s %t.o -shared
4# RUN: llvm-objdump -t -h %t.so | FileCheck %s
5
6SECTIONS {
7  . = . + 4;
8  .text : {
9    *(.text)
10    foo1 = ADDR(.text) + 1; bar1 = 1 + ADDR(.text);
11    foo2 = ADDR(.text) & 1; bar2 = 1 & ADDR(.text);
12    foo3 = ADDR(.text) | 1; bar3 = 1 | ADDR(.text);
13  }
14};
15
16# CHECK:  5 .text         00000000 000000000000014c
17
18# CHECK: 000000000000014d         .text		 00000000 foo1
19# CHECK: 000000000000014d         .text		 00000000 bar1
20# CHECK: 0000000000000000         .text		 00000000 foo2
21# CHECK: 0000000000000000         .text		 00000000 bar2
22# CHECK: 000000000000014d         .text		 00000000 foo3
23# CHECK: 000000000000014d         .text		 00000000 bar3
24