2013-04-12 04:06:46 +00:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -t | FileCheck %s
|
2010-11-01 14:28:48 +00:00
|
|
|
|
|
|
|
// This is a long test that checks that the aliases created by weakref are
|
|
|
|
// never in the symbol table and that the only case it causes a symbol to
|
|
|
|
// be output as a weak undefined symbol is if that variable is not defined
|
|
|
|
// in this file and all the references to it are done via the alias.
|
|
|
|
|
|
|
|
.weakref foo1, bar1
|
|
|
|
|
|
|
|
.weakref foo2, bar2
|
|
|
|
.long bar2
|
|
|
|
|
|
|
|
.weakref foo3, bar3
|
|
|
|
.long foo3
|
|
|
|
|
|
|
|
.weakref foo4, bar4
|
|
|
|
.long foo4
|
|
|
|
.long bar4
|
|
|
|
|
|
|
|
.weakref foo5, bar5
|
|
|
|
.long bar5
|
|
|
|
.long foo5
|
|
|
|
|
|
|
|
bar6:
|
|
|
|
.weakref foo6, bar6
|
|
|
|
|
|
|
|
bar7:
|
|
|
|
.weakref foo7, bar7
|
|
|
|
.long bar7
|
|
|
|
|
|
|
|
bar8:
|
|
|
|
.weakref foo8, bar8
|
|
|
|
.long foo8
|
|
|
|
|
|
|
|
bar9:
|
|
|
|
.weakref foo9, bar9
|
|
|
|
.long foo9
|
|
|
|
.long bar9
|
|
|
|
|
|
|
|
bar10:
|
|
|
|
.global bar10
|
|
|
|
.weakref foo10, bar10
|
|
|
|
.long bar10
|
|
|
|
.long foo10
|
|
|
|
|
|
|
|
bar11:
|
|
|
|
.global bar11
|
|
|
|
.weakref foo11, bar11
|
|
|
|
|
|
|
|
bar12:
|
|
|
|
.global bar12
|
|
|
|
.weakref foo12, bar12
|
|
|
|
.long bar12
|
|
|
|
|
|
|
|
bar13:
|
|
|
|
.global bar13
|
|
|
|
.weakref foo13, bar13
|
|
|
|
.long foo13
|
|
|
|
|
|
|
|
bar14:
|
|
|
|
.global bar14
|
|
|
|
.weakref foo14, bar14
|
|
|
|
.long foo14
|
|
|
|
.long bar14
|
|
|
|
|
|
|
|
bar15:
|
|
|
|
.global bar15
|
|
|
|
.weakref foo15, bar15
|
|
|
|
.long bar15
|
|
|
|
.long foo15
|
|
|
|
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK: Symbols [
|
|
|
|
// CHECK-NEXT: Symbol {
|
2013-06-05 20:33:54 +00:00
|
|
|
// CHECK-NEXT: Name: (0)
|
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local (0x0)
|
|
|
|
// CHECK-NEXT: Type: None (0x0)
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 05:00:34 +00:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-06-05 20:33:54 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar6
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x18
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar7
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x18
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar8
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x1C
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar9
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x20
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: .text
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: Section
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: .data
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: Section
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .data (0x3)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: .bss
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: Section
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .bss (0x4)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar10
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x28
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar11
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x30
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar12
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x30
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar13
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x34
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar14
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x38
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar15
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x40
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar2
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 05:00:34 +00:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar3
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Weak
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 05:00:34 +00:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar4
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 05:00:34 +00:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-04-30 16:25:02 +00:00
|
|
|
// CHECK-NEXT: Name: bar5
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 05:00:34 +00:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|