1# REQUIRES: aarch64, x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t.o
3# RUN: ld.lld %t.o -T %s -o %t
4# RUN: llvm-nm %t | FileCheck %s
5
6## AArch64 needs thunks and has different address finalization process, so test
7## it as well.
8# RUN: llvm-mc -filetype=obj -triple=aarch64 /dev/null -o %t.o
9# RUN: ld.lld %t.o -T %s -o %t
10# RUN: llvm-nm %t | FileCheck %s
11
12# CHECK: 0000000000001004 T a
13# CHECK: 0000000000001003 T b
14# CHECK: 0000000000001002 T c
15# CHECK: 0000000000001001 T d
16# CHECK: 0000000000001000 T e
17
18SECTIONS {
19  . = 0x1000;
20  a = b + 1;
21  b = c + 1;
22  c = d + 1;
23  d = e + 1;
24  e = .;
25}
26