summaryrefslogtreecommitdiffstats
path: root/test/MC/AsmParser
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/AsmParser')
-rw-r--r--test/MC/AsmParser/align_invalid.s10
-rw-r--r--test/MC/AsmParser/directive_values.s6
-rw-r--r--test/MC/AsmParser/section_names.s62
3 files changed, 78 insertions, 0 deletions
diff --git a/test/MC/AsmParser/align_invalid.s b/test/MC/AsmParser/align_invalid.s
new file mode 100644
index 0000000..0d06d94
--- /dev/null
+++ b/test/MC/AsmParser/align_invalid.s
@@ -0,0 +1,10 @@
+# RUN: llvm-mc -triple i386-linux-gnu < %s 2>&1 | FileCheck %s -check-prefix=ELF
+# RUN: llvm-mc -triple i386-apple-darwin < %s 2>&1 | FileCheck %s -check-prefix=DARWIN
+
+.align 3
+# ELF: error: alignment must be a power of 2
+# DARWIN-NOT: error
+
+.align 32
+# ELF-NOT: error
+# DARWIN: error: invalid alignment value
diff --git a/test/MC/AsmParser/directive_values.s b/test/MC/AsmParser/directive_values.s
index 6c79c38..ed932b2 100644
--- a/test/MC/AsmParser/directive_values.s
+++ b/test/MC/AsmParser/directive_values.s
@@ -63,3 +63,9 @@ TEST7:
# CHECK-NEXT: .byte 2
# CHECK-NEXT: .byte 3
# CHECK-NEXT: .byte 4
+
+TEST8:
+ .long 0x200000UL+1
+ .long 0x200000L+1
+# CHECK: .long 2097153
+# CHECK: .long 2097153
diff --git a/test/MC/AsmParser/section_names.s b/test/MC/AsmParser/section_names.s
new file mode 100644
index 0000000..332cdbe
--- /dev/null
+++ b/test/MC/AsmParser/section_names.s
@@ -0,0 +1,62 @@
+# RUN: llvm-mc -triple i386-pc-linux-gnu -filetype=obj -o %t %s
+# RUN: elf-dump --dump-section-data < %t | FileCheck %s
+.section .nobits
+.byte 1
+.section .nobits2
+.byte 1
+.section .nobitsfoo
+.byte 1
+.section .init_array
+.byte 1
+.section .init_array2
+.byte 1
+.section .init_arrayfoo
+.byte 1
+.section .fini_array
+.byte 1
+.section .fini_array2
+.byte 1
+.section .fini_arrayfoo
+.byte 1
+.section .preinit_array
+.byte 1
+.section .preinit_array2
+.byte 1
+.section .preinit_arrayfoo
+.byte 1
+.section .note
+.byte 1
+.section .note2
+.byte 1
+.section .notefoo
+.byte 1
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobits'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobits2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobitsfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_array'
+# CHECK-NEXT: ('sh_type', 0x0000000e)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_array'
+# CHECK-NEXT: ('sh_type', 0x0000000f)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_array'
+# CHECK-NEXT: ('sh_type', 0x00000010)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.note'
+# CHECK-NEXT: ('sh_type', 0x00000007)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.note2'
+# CHECK-NEXT: ('sh_type', 0x00000007)
+#CHECK: (('sh_name', 0x00000{{...}}) # '.notefoo'
+# CHECK-NEXT: ('sh_type', 0x00000007)
OpenPOWER on IntegriCloud