aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/COFF
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-05-29 02:49:00 -0700
committerStephen Hines <srhines@google.com>2014-05-29 02:49:00 -0700
commitdce4a407a24b04eebc6a376f8e62b41aaa7b071f (patch)
treedcebc53f2b182f145a2e659393bf9a0472cedf23 /test/MC/COFF
parent220b921aed042f9e520c26cffd8282a94c66c3d5 (diff)
downloadexternal_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.zip
external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.gz
external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.bz2
Update LLVM for 3.5 rebase (r209712).
Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
Diffstat (limited to 'test/MC/COFF')
-rw-r--r--test/MC/COFF/alias.s2
-rw-r--r--test/MC/COFF/comm.ll4
-rw-r--r--test/MC/COFF/comm.s4
-rw-r--r--test/MC/COFF/directive-section-characteristics.ll17
-rw-r--r--test/MC/COFF/file.s47
-rw-r--r--test/MC/COFF/global_ctors_dtors.ll28
-rw-r--r--test/MC/COFF/initialised-data.ll7
-rw-r--r--test/MC/COFF/invalid-def.s5
-rw-r--r--test/MC/COFF/invalid-endef.s4
-rw-r--r--test/MC/COFF/invalid-scl-range.s6
-rw-r--r--test/MC/COFF/invalid-scl.s4
-rw-r--r--test/MC/COFF/invalid-type-range.s6
-rw-r--r--test/MC/COFF/invalid-type.s4
-rw-r--r--test/MC/COFF/offset.s19
-rw-r--r--test/MC/COFF/symbol-alias.s2
-rw-r--r--test/MC/COFF/weak-symbol.ll8
16 files changed, 151 insertions, 16 deletions
diff --git a/test/MC/COFF/alias.s b/test/MC/COFF/alias.s
index f6f6d46..dc4f65a 100644
--- a/test/MC/COFF/alias.s
+++ b/test/MC/COFF/alias.s
@@ -68,7 +68,7 @@ weak_aliased_to_external = external2
// CHECK-NEXT: Section: .text (1)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
-// CHECK-NEXT: StorageClass: Static (0x3)
+// CHECK-NEXT: StorageClass: External (0x2)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
diff --git a/test/MC/COFF/comm.ll b/test/MC/COFF/comm.ll
index 74da557..6fe122e 100644
--- a/test/MC/COFF/comm.ll
+++ b/test/MC/COFF/comm.ll
@@ -9,5 +9,5 @@
; CHECK: .lcomm _a,1
; CHECK: .lcomm _b,8,8
; .comm uses log2 alignment
-; CHECK: .comm _c,1,0
-; CHECK: .comm _d,8,3
+; CHECK: .comm _c,1
+; CHECK: .comm _d,8
diff --git a/test/MC/COFF/comm.s b/test/MC/COFF/comm.s
index 21ae5d2..37db75f 100644
--- a/test/MC/COFF/comm.s
+++ b/test/MC/COFF/comm.s
@@ -1,7 +1,7 @@
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s
.lcomm _a,4,4
-.comm _b, 4, 2
+.comm _b, 4
// CHECK: Symbol {
@@ -17,7 +17,7 @@
// CHECK: Symbol {
// CHECK: Name: _b
// CHECK-NEXT: Value: 4
-// CHECK-NEXT: Section: .bss
+// CHECK-NEXT: Section: (0)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: External
diff --git a/test/MC/COFF/directive-section-characteristics.ll b/test/MC/COFF/directive-section-characteristics.ll
new file mode 100644
index 0000000..ca8102a
--- /dev/null
+++ b/test/MC/COFF/directive-section-characteristics.ll
@@ -0,0 +1,17 @@
+; RUN: llc -mtriple i686-windows -filetype obj -o - %s | llvm-readobj -sections \
+; RUN: | FileCheck %s
+
+define dllexport void @function() {
+entry:
+ ret void
+}
+
+; CHECK: Section {
+; CHECK: Name: .drectve
+; CHECK: Characteristics [
+; CHECK: IMAGE_SCN_ALIGN_1BYTES
+; CHECK: IMAGE_SCN_LNK_INFO
+; CHECK: IMAGE_SCN_LNK_REMOVE
+; CHECK: ]
+; CHECK: }
+
diff --git a/test/MC/COFF/file.s b/test/MC/COFF/file.s
new file mode 100644
index 0000000..132e82b
--- /dev/null
+++ b/test/MC/COFF/file.s
@@ -0,0 +1,47 @@
+// RUN: llvm-mc -triple i686-windows -filetype obj %s -o - | llvm-objdump -t - \
+// RUN: | FileCheck %s
+
+// RUN: llvm-mc -triple i686-windows -filetype obj %s -o - \
+// RUN: | llvm-readobj -symbols | FileCheck %s -check-prefix CHECK-SCN
+
+ .file "null-padded.asm"
+// CHECK: (nx 1) {{0x[0-9]+}} .file
+// CHECK-NEXT: AUX null-padded.asm{{$}}
+
+ .file "eighteen-chars.asm"
+
+// CHECK: (nx 1) {{0x[0-9]+}} .file
+// CHECK-NEXT: AUX eighteen-chars.asm{{$}}
+
+ .file "multiple-auxiliary-entries.asm"
+
+// CHECK: (nx 2) {{0x[0-9]+}} .file
+// CHECK-NEXT: AUX multiple-auxiliary-entries.asm{{$}}
+
+// CHECK-SCN: Symbols [
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: null-padded.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: eighteen-chars.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: multiple-auxiliary-entries.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: ]
+
diff --git a/test/MC/COFF/global_ctors_dtors.ll b/test/MC/COFF/global_ctors_dtors.ll
index 2a25219..046e93a 100644
--- a/test/MC/COFF/global_ctors_dtors.ll
+++ b/test/MC/COFF/global_ctors_dtors.ll
@@ -9,8 +9,13 @@
@.str2 = private unnamed_addr constant [12 x i8] c"destructing\00", align 1
@.str3 = private unnamed_addr constant [5 x i8] c"main\00", align 1
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @a_global_ctor }]
-@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @a_global_dtor }]
+%ini = type { i32, void()*, i8* }
+
+@llvm.global_ctors = appending global [2 x %ini ] [
+ %ini { i32 65535, void ()* @a_global_ctor, i8* null },
+ %ini { i32 65535, void ()* @b_global_ctor, i8* bitcast (i32* @b to i8*) }
+]
+@llvm.global_dtors = appending global [1 x %ini ] [%ini { i32 65535, void ()* @a_global_dtor, i8* null }]
declare i32 @puts(i8*)
@@ -19,6 +24,13 @@ define void @a_global_ctor() nounwind {
ret void
}
+@b = global i32 zeroinitializer
+
+define void @b_global_ctor() nounwind {
+ store i32 42, i32* @b
+ ret void
+}
+
define void @a_global_dtor() nounwind {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str2, i32 0, i32 0))
ret void
@@ -29,11 +41,15 @@ define i32 @main() nounwind {
ret i32 0
}
-; WIN32: .section .CRT$XCU,"r"
+; WIN32: .section .CRT$XCU,"rd"
; WIN32: a_global_ctor
-; WIN32: .section .CRT$XTX,"r"
+; WIN32: .section .CRT$XCU,"rd",associative .bss,{{_?}}b
+; WIN32: b_global_ctor
+; WIN32: .section .CRT$XTX,"rd"
; WIN32: a_global_dtor
-; MINGW32: .section .ctors,"w"
+; MINGW32: .section .ctors,"wd"
; MINGW32: a_global_ctor
-; MINGW32: .section .dtors,"w"
+; MINGW32: .section .ctors,"wd",associative .bss,{{_?}}b
+; MINGW32: b_global_ctor
+; MINGW32: .section .dtors,"wd"
; MINGW32: a_global_dtor
diff --git a/test/MC/COFF/initialised-data.ll b/test/MC/COFF/initialised-data.ll
new file mode 100644
index 0000000..c428469
--- /dev/null
+++ b/test/MC/COFF/initialised-data.ll
@@ -0,0 +1,7 @@
+; RUN: llc -mtriple i686-windows %s -o - | FileCheck %s
+; RUN: llc -mtriple x86_64-windows %s -o - | FileCheck %s
+
+@data = dllexport constant [5 x i8] c"data\00", align 1
+
+; CHECK: .section .rdata,"rd"
+
diff --git a/test/MC/COFF/invalid-def.s b/test/MC/COFF/invalid-def.s
new file mode 100644
index 0000000..42821c2
--- /dev/null
+++ b/test/MC/COFF/invalid-def.s
@@ -0,0 +1,5 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .def first
+ .def second
+
diff --git a/test/MC/COFF/invalid-endef.s b/test/MC/COFF/invalid-endef.s
new file mode 100644
index 0000000..c6fd8f5
--- /dev/null
+++ b/test/MC/COFF/invalid-endef.s
@@ -0,0 +1,4 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .endef
+
diff --git a/test/MC/COFF/invalid-scl-range.s b/test/MC/COFF/invalid-scl-range.s
new file mode 100644
index 0000000..5722505
--- /dev/null
+++ b/test/MC/COFF/invalid-scl-range.s
@@ -0,0 +1,6 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .def storage_class_range
+ .scl 1337
+ .endef
+
diff --git a/test/MC/COFF/invalid-scl.s b/test/MC/COFF/invalid-scl.s
new file mode 100644
index 0000000..8565a5a
--- /dev/null
+++ b/test/MC/COFF/invalid-scl.s
@@ -0,0 +1,4 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .scl 1337
+
diff --git a/test/MC/COFF/invalid-type-range.s b/test/MC/COFF/invalid-type-range.s
new file mode 100644
index 0000000..92874cc
--- /dev/null
+++ b/test/MC/COFF/invalid-type-range.s
@@ -0,0 +1,6 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .def invalid_type_range
+ .type 65536
+ .endef
+
diff --git a/test/MC/COFF/invalid-type.s b/test/MC/COFF/invalid-type.s
new file mode 100644
index 0000000..a1e131e
--- /dev/null
+++ b/test/MC/COFF/invalid-type.s
@@ -0,0 +1,4 @@
+# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s
+
+ .type 65536
+
diff --git a/test/MC/COFF/offset.s b/test/MC/COFF/offset.s
new file mode 100644
index 0000000..d0d3710
--- /dev/null
+++ b/test/MC/COFF/offset.s
@@ -0,0 +1,19 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | llvm-readobj -t -r | FileCheck %s
+
+ .data
+ .globl test1_foo
+test1_foo:
+ .long 42
+
+ .globl test1_zed
+test1_zed = test1_foo + 1
+
+// CHECK: Symbol {
+// CHECK: Name: test1_zed
+// CHECK-NEXT: Value: 1
+// CHECK-NEXT: Section: .data
+// CHECK-NEXT: BaseType: Null
+// CHECK-NEXT: ComplexType: Null
+// CHECK-NEXT: StorageClass: External
+// CHECK-NEXT: AuxSymbolCount: 0
+// CHECK-NEXT: }
diff --git a/test/MC/COFF/symbol-alias.s b/test/MC/COFF/symbol-alias.s
index ccada37..71ccec3 100644
--- a/test/MC/COFF/symbol-alias.s
+++ b/test/MC/COFF/symbol-alias.s
@@ -51,7 +51,7 @@ _bar_alias = _bar
// CHECK-NEXT: Value: [[FOO_VALUE]]
// CHECK-NEXT: Section: [[FOO_SECTION_NUMBER]]
// CHECK-NEXT: BaseType: [[FOO_SIMPLE_TYPE]]
-// CHECK-NEXT: ComplexType: [[FOO_COMPLEX_TYPE]]
+// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: [[FOO_STORAGE_CLASS]]
// CHECK-NEXT: AuxSymbolCount: [[FOO_NUMBER_OF_AUX_SYMBOLS]]
diff --git a/test/MC/COFF/weak-symbol.ll b/test/MC/COFF/weak-symbol.ll
index c06692e..fd78307 100644
--- a/test/MC/COFF/weak-symbol.ll
+++ b/test/MC/COFF/weak-symbol.ll
@@ -28,20 +28,20 @@ define weak void @f() section ".sect" {
}
; Weak global
-; X86: .section .data,"r",discard,_a
+; X86: .section .data,"rd",discard,_a
; X86: .globl _a
; X86: .zero 12
;
-; X64: .section .data,"r",discard,a
+; X64: .section .data,"rd",discard,a
; X64: .globl a
; X64: .zero 12
@a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"
-; X86: .section .tls$,"w",discard,_b
+; X86: .section .tls$,"wd",discard,_b
; X86: .globl _b
; X86: .long 0
;
-; X64: .section .tls$,"w",discard,b
+; X64: .section .tls$,"wd",discard,b
; X64: .globl b
; X64: .long 0