2017-01-24 11:41:20 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
|
|
|
|
# RUN: ld.lld -r %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck %s
|
2017-01-24 11:41:20 +08:00
|
|
|
# RUN: ld.lld -r --no-define-common %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck %s
|
2017-01-24 11:41:20 +08:00
|
|
|
# RUN: ld.lld -r --define-common %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s
|
2017-01-24 11:41:20 +08:00
|
|
|
# RUN: ld.lld -r -d %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s
|
2017-01-24 11:41:20 +08:00
|
|
|
# RUN: ld.lld -r -dc %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s
|
2017-01-24 11:41:20 +08:00
|
|
|
# RUN: ld.lld -r -dp %t1.o -o %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s
|
2017-01-24 11:41:20 +08:00
|
|
|
|
|
|
|
# CHECK: Symbol {
|
2017-02-11 04:10:16 +08:00
|
|
|
# CHECK: Name: common
|
2017-01-24 11:41:20 +08:00
|
|
|
# CHECK-NEXT: Value: 0x4
|
|
|
|
# CHECK-NEXT: Size: 4
|
2017-02-11 04:10:16 +08:00
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type: Object
|
2017-01-24 11:41:20 +08:00
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Common (0xFFF2)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
|
|
|
|
# DEFCOMM: Symbol {
|
2017-02-11 04:10:16 +08:00
|
|
|
# DEFCOMM: Name: common
|
2017-01-24 11:41:20 +08:00
|
|
|
# DEFCOMM-NEXT: Value: 0x0
|
|
|
|
# DEFCOMM-NEXT: Size: 4
|
2017-02-11 04:10:16 +08:00
|
|
|
# DEFCOMM-NEXT: Binding: Global
|
|
|
|
# DEFCOMM-NEXT: Type: Object
|
2017-01-24 11:41:20 +08:00
|
|
|
# DEFCOMM-NEXT: Other: 0
|
2017-11-06 12:33:58 +08:00
|
|
|
# DEFCOMM-NEXT: Section: COMMON
|
2017-01-24 11:41:20 +08:00
|
|
|
# DEFCOMM-NEXT: }
|
|
|
|
|
2020-02-13 13:48:45 +08:00
|
|
|
# RUN: not ld.lld -shared --no-define-common %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
|
2017-12-01 04:46:33 +08:00
|
|
|
# ERROR: error: -no-define-common not supported in non relocatable output
|
|
|
|
|
2017-01-24 11:41:20 +08:00
|
|
|
.comm common,4,4
|