[llvm-commits] [llvm] r122786 - in /llvm/trunk/test/MC/ELF: basic-elf-32.s basic-elf-64.s basic-elf.ll call-abs.ll call-abs.s

Evan Cheng evan.cheng at apple.com
Mon Jan 3 15:47:14 PST 2011


Author: evancheng
Date: Mon Jan  3 17:47:14 2011
New Revision: 122786

URL: http://llvm.org/viewvc/llvm-project?rev=122786&view=rev
Log:
Convert MC tests to .s so codegen changes won't break them.

Added:
    llvm/trunk/test/MC/ELF/basic-elf-32.s
    llvm/trunk/test/MC/ELF/basic-elf-64.s
    llvm/trunk/test/MC/ELF/call-abs.s
Removed:
    llvm/trunk/test/MC/ELF/basic-elf.ll
    llvm/trunk/test/MC/ELF/call-abs.ll

Added: llvm/trunk/test/MC/ELF/basic-elf-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf-32.s?rev=122786&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/basic-elf-32.s (added)
+++ llvm/trunk/test/MC/ELF/basic-elf-32.s Mon Jan  3 17:47:14 2011
@@ -0,0 +1,78 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
+
+	.text
+	.globl	main
+	.align	16, 0x90
+	.type	main, at function
+main:                                   # @main
+# BB#0:
+	subl	$4, %esp
+	movl	$.L.str1, (%esp)
+	calll	puts
+	movl	$.L.str2, (%esp)
+	calll	puts
+	xorl	%eax, %eax
+	addl	$4, %esp
+	ret
+.Ltmp0:
+	.size	main, .Ltmp0-main
+
+	.type	.L.str1, at object         # @.str1
+	.section	.rodata.str1.1,"aMS", at progbits,1
+.L.str1:
+	.asciz	 "Hello"
+	.size	.L.str1, 6
+
+	.type	.L.str2, at object         # @.str2
+.L.str2:
+	.asciz	 "World!"
+	.size	.L.str2, 7
+
+	.section	.note.GNU-stack,"", at progbits
+
+// CHECK: ('e_indent[EI_CLASS]', 0x00000001)
+// CHECK: ('e_indent[EI_DATA]', 0x00000001)
+// CHECK: ('e_indent[EI_VERSION]', 0x00000001)
+// CHECK: ('_sections', [
+// CHECK:   # Section 0
+// CHECK:   (('sh_name', 0x00000000) # ''
+
+// CHECK:   # '.text'
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK:   # 'main'
+// CHECK:   ('st_bind', 0x00000001)
+// CHECK-NEXT: ('st_type', 0x00000002)
+
+// CHECK:   # 'puts'
+// CHECK:   ('st_bind', 0x00000001)
+// CHECK-NEXT: ('st_type', 0x00000000)
+
+// CHECK:   # '.rel.text'
+
+// CHECK:   ('_relocations', [
+// CHECK:     # Relocation 0x00000000
+// CHECK:     (('r_offset', 0x00000006)
+// CHECK:      ('r_type', 0x00000001)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000001
+// CHECK:     (('r_offset', 0x0000000b)
+// CHECK:      ('r_type', 0x00000002)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000002
+// CHECK:     (('r_offset', 0x00000012)
+// CHECK:      ('r_type', 0x00000001)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000003
+// CHECK:     (('r_offset', 0x00000017)
+// CHECK:      ('r_type', 0x00000002)
+// CHECK:     ),
+// CHECK:   ])

Added: llvm/trunk/test/MC/ELF/basic-elf-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf-64.s?rev=122786&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/basic-elf-64.s (added)
+++ llvm/trunk/test/MC/ELF/basic-elf-64.s Mon Jan  3 17:47:14 2011
@@ -0,0 +1,82 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
+
+        .text
+	.globl	main
+	.align	16, 0x90
+	.type	main, at function
+main:                                   # @main
+# BB#0:
+	subq	$8, %rsp
+	movl	$.L.str1, %edi
+	callq	puts
+	movl	$.L.str2, %edi
+	callq	puts
+	xorl	%eax, %eax
+	addq	$8, %rsp
+	ret
+.Ltmp0:
+	.size	main, .Ltmp0-main
+
+	.type	.L.str1, at object         # @.str1
+	.section	.rodata.str1.1,"aMS", at progbits,1
+.L.str1:
+	.asciz	 "Hello"
+	.size	.L.str1, 6
+
+	.type	.L.str2, at object         # @.str2
+.L.str2:
+	.asciz	 "World!"
+	.size	.L.str2, 7
+
+	.section	.note.GNU-stack,"", at progbits
+
+// CHECK: ('e_indent[EI_CLASS]', 0x00000002)
+// CHECK: ('e_indent[EI_DATA]', 0x00000001)
+// CHECK: ('e_indent[EI_VERSION]', 0x00000001)
+// CHECK: ('_sections', [
+// CHECK:   # Section 0
+// CHECK:   (('sh_name', 0x00000000) # ''
+
+// CHECK:   # '.text'
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK: ('st_bind', 0x00000000)
+// CHECK: ('st_type', 0x00000003)
+
+// CHECK:   # 'main'
+// CHECK-NEXT: ('st_bind', 0x00000001)
+// CHECK-NEXT: ('st_type', 0x00000002)
+
+// CHECK:   # 'puts'
+// CHECK-NEXT: ('st_bind', 0x00000001)
+// CHECK-NEXT: ('st_type', 0x00000000)
+
+// CHECK:   # '.rela.text'
+
+// CHECK:   ('_relocations', [
+// CHECK:     # Relocation 0x00000000
+// CHECK:     (('r_offset', 0x00000005)
+// CHECK:      ('r_type', 0x0000000a)
+// CHECK:      ('r_addend', 0x00000000)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000001
+// CHECK:     (('r_offset', 0x0000000a)
+// CHECK:      ('r_type', 0x00000002)
+// CHECK:      ('r_addend', 0xfffffffc)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000002
+// CHECK:     (('r_offset', 0x0000000f)
+// CHECK:      ('r_type', 0x0000000a)
+// CHECK:      ('r_addend', 0x00000006)
+// CHECK:     ),
+// CHECK:     # Relocation 0x00000003
+// CHECK:     (('r_offset', 0x00000014)
+// CHECK:      ('r_type', 0x00000002)
+// CHECK:      ('r_addend', 0xfffffffc)
+// CHECK:     ),
+// CHECK:   ])

Removed: llvm/trunk/test/MC/ELF/basic-elf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf.ll?rev=122785&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/basic-elf.ll (original)
+++ llvm/trunk/test/MC/ELF/basic-elf.ll (removed)
@@ -1,111 +0,0 @@
-; RUN: llc -filetype=obj -mtriple i686-pc-linux-gnu %s -o - | elf-dump | FileCheck -check-prefix=32 %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck -check-prefix=64 %s
-
- at .str1 = private constant [6 x i8] c"Hello\00"
- at .str2 = private constant [7 x i8] c"World!\00"
-
-define i32 @main() nounwind {
-  %1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8]* @.str1, i32 0, i32 0))
-  %2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @.str2, i32 0, i32 0))
-  ret i32 0
-}
-
-declare i32 @puts(i8* nocapture) nounwind
-
-; 32: ('e_indent[EI_CLASS]', 0x00000001)
-; 32: ('e_indent[EI_DATA]', 0x00000001)
-; 32: ('e_indent[EI_VERSION]', 0x00000001)
-; 32: ('_sections', [
-; 32:   # Section 0
-; 32:   (('sh_name', 0x00000000) # ''
-
-; 32:   # '.text'
-
-; 32: ('st_bind', 0x00000000)
-; 32: ('st_type', 0x00000003)
-
-; 32: ('st_bind', 0x00000000)
-; 32: ('st_type', 0x00000003)
-
-; 32: ('st_bind', 0x00000000)
-; 32: ('st_type', 0x00000003)
-
-; 32:   # 'main'
-; 32:   ('st_bind', 0x00000001)
-; 32-NEXT: ('st_type', 0x00000002)
-
-; 32:   # 'puts'
-; 32:   ('st_bind', 0x00000001)
-; 32-NEXT: ('st_type', 0x00000000)
-
-; 32:   # '.rel.text'
-
-; 32:   ('_relocations', [
-; 32:     # Relocation 0x00000000
-; 32:     (('r_offset', 0x00000006)
-; 32:      ('r_type', 0x00000001)
-; 32:     ),
-; 32:     # Relocation 0x00000001
-; 32:     (('r_offset', 0x0000000b)
-; 32:      ('r_type', 0x00000002)
-; 32:     ),
-; 32:     # Relocation 0x00000002
-; 32:     (('r_offset', 0x00000012)
-; 32:      ('r_type', 0x00000001)
-; 32:     ),
-; 32:     # Relocation 0x00000003
-; 32:     (('r_offset', 0x00000017)
-; 32:      ('r_type', 0x00000002)
-; 32:     ),
-; 32:   ])
-
-; 64: ('e_indent[EI_CLASS]', 0x00000002)
-; 64: ('e_indent[EI_DATA]', 0x00000001)
-; 64: ('e_indent[EI_VERSION]', 0x00000001)
-; 64: ('_sections', [
-; 64:   # Section 0
-; 64:   (('sh_name', 0x00000000) # ''
-
-; 64:   # '.text'
-
-; 64: ('st_bind', 0x00000000)
-; 64: ('st_type', 0x00000003)
-
-; 64: ('st_bind', 0x00000000)
-; 64: ('st_type', 0x00000003)
-
-; 64: ('st_bind', 0x00000000)
-; 64: ('st_type', 0x00000003)
-
-; 64:   # 'main'
-; 64-NEXT: ('st_bind', 0x00000001)
-; 64-NEXT: ('st_type', 0x00000002)
-
-; 64:   # 'puts'
-; 64-NEXT: ('st_bind', 0x00000001)
-; 64-NEXT: ('st_type', 0x00000000)
-
-; 64:   # '.rela.text'
-
-; 64:   ('_relocations', [
-; 64:     # Relocation 0x00000000
-; 64:     (('r_offset', 0x00000005)
-; 64:      ('r_type', 0x0000000a)
-; 64:      ('r_addend', 0x00000000)
-; 64:     ),
-; 64:     # Relocation 0x00000001
-; 64:     (('r_offset', 0x0000000a)
-; 64:      ('r_type', 0x00000002)
-; 64:      ('r_addend', 0xfffffffc)
-; 64:     ),
-; 64:     # Relocation 0x00000002
-; 64:     (('r_offset', 0x0000000f)
-; 64:      ('r_type', 0x0000000a)
-; 64:      ('r_addend', 0x00000006)
-; 64:     ),
-; 64:     # Relocation 0x00000003
-; 64:     (('r_offset', 0x00000014)
-; 64:      ('r_type', 0x00000002)
-; 64:      ('r_addend', 0xfffffffc)
-; 64:     ),
-; 64:   ])

Removed: llvm/trunk/test/MC/ELF/call-abs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/call-abs.ll?rev=122785&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/call-abs.ll (original)
+++ llvm/trunk/test/MC/ELF/call-abs.ll (removed)
@@ -1,16 +0,0 @@
-; RUN: llc -filetype=obj -mtriple i686-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
-
-define i32 @f() nounwind optsize ssp {
-entry:
-  %call = tail call i32 inttoptr (i64 42 to i32 ()*)() nounwind optsize
-  %add = add nsw i32 %call, 1
-  ret i32 %add
-}
-
-; CHECK:      ('_relocations', [
-; CHECK-NEXT:  # Relocation 0x00000000
-; CHECK-NEXT:  (('r_offset', 0x00000004)
-; CHECK-NEXT:   ('r_sym', 0x00000000)
-; CHECK-NEXT:   ('r_type', 0x00000002)
-; CHECK-NEXT:  ),
-; CHECK-NEXT: ])

Added: llvm/trunk/test/MC/ELF/call-abs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/call-abs.s?rev=122786&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/call-abs.s (added)
+++ llvm/trunk/test/MC/ELF/call-abs.s Mon Jan  3 17:47:14 2011
@@ -0,0 +1,24 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
+
+	.text
+	.globl	f
+	.type	f, at function
+f:                                      # @f
+# BB#0:                                 # %entry
+	subl	$4, %esp
+	calll	42
+	incl	%eax
+	addl	$4, %esp
+	ret
+.Ltmp0:
+	.size	f, .Ltmp0-f
+
+	.section	.note.GNU-stack,"", at progbits
+
+// CHECK:      ('_relocations', [
+// CHECK-NEXT:  # Relocation 0x00000000
+// CHECK-NEXT:  (('r_offset', 0x00000004)
+// CHECK-NEXT:   ('r_sym', 0x00000000)
+// CHECK-NEXT:   ('r_type', 0x00000002)
+// CHECK-NEXT:  ),
+// CHECK-NEXT: ])





More information about the llvm-commits mailing list