diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-10 21:22:52 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-10 21:23:04 +0000 |
commit | 31195f0bdca6ee2a5e72d07edf13e1d81206d949 (patch) | |
tree | 1b2c9792582e12f5af0b1512e3094425f0dc0df9 /test/MC/ELF | |
parent | c75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff) | |
parent | 4c5e43da7792f75567b693105cc53e3f1992ad98 (diff) | |
download | external_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.zip external_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.tar.gz external_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.tar.bz2 |
Merge "Update aosp/master llvm for rebase to r233350"
Diffstat (limited to 'test/MC/ELF')
-rw-r--r-- | test/MC/ELF/alias.s | 3 | ||||
-rw-r--r-- | test/MC/ELF/cfi-adjust-cfa-offset.s | 24 | ||||
-rw-r--r-- | test/MC/ELF/cfi-version.ll | 14 | ||||
-rw-r--r-- | test/MC/ELF/entsize.ll | 8 | ||||
-rw-r--r-- | test/MC/ELF/gen-dwarf.s | 1 | ||||
-rw-r--r-- | test/MC/ELF/relocation-386.s | 9 | ||||
-rw-r--r-- | test/MC/ELF/relocation.s | 17 | ||||
-rw-r--r-- | test/MC/ELF/size.s | 15 | ||||
-rw-r--r-- | test/MC/ELF/weak-diff.s | 12 |
9 files changed, 87 insertions, 16 deletions
diff --git a/test/MC/ELF/alias.s b/test/MC/ELF/alias.s index 8e13182..78df737 100644 --- a/test/MC/ELF/alias.s +++ b/test/MC/ELF/alias.s @@ -99,12 +99,15 @@ bar6: // CHECK-NEXT: } // CHECK-NEXT: Symbol { // CHECK-NEXT: Name: .text (0) +// CHECK-NOT: Symbol { // CHECK: } // CHECK-NEXT: Symbol { // CHECK-NEXT: Name: .data (0) +// CHECK-NOT: Symbol { // CHECK: } // CHECK-NEXT: Symbol { // CHECK-NEXT: Name: .bss (0) +// CHECK-NOT: Symbol { // CHECK: } // CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar3 diff --git a/test/MC/ELF/cfi-adjust-cfa-offset.s b/test/MC/ELF/cfi-adjust-cfa-offset.s index 9d639f7..200f897 100644 --- a/test/MC/ELF/cfi-adjust-cfa-offset.s +++ b/test/MC/ELF/cfi-adjust-cfa-offset.s @@ -11,6 +11,16 @@ f: ret .cfi_endproc + .cfi_startproc + nop + .cfi_adjust_cfa_offset 4 + .cfi_endproc + + .cfi_startproc + nop + .cfi_adjust_cfa_offset 4 + .cfi_endproc + // CHECK: Section { // CHECK: Index: 4 // CHECK-NEXT: Name: .eh_frame @@ -20,7 +30,7 @@ f: // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: 0x50 -// CHECK-NEXT: Size: 56 +// CHECK-NEXT: Size: 96 // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 8 @@ -29,9 +39,11 @@ f: // CHECK-NEXT: ] // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 14000000 00000000 037A5200 01781001 -// CHECK-NEXT: 0010: 1B0C0708 90010000 1C000000 1C000000 +// CHECK-NEXT: 0010: 1B0C0708 90010000 18000000 1C000000 // CHECK-NEXT: 0020: 00000000 0A000000 00440E10 410E1444 -// CHECK-NEXT: 0030: 0E080000 00000000 +// CHECK-NEXT: 0030: 0E080000 10000000 38000000 00000000 +// CHECK-NEXT: 0040: 01000000 00410E0C 14000000 4C000000 +// CHECK-NEXT: 0050: 00000000 01000000 00410E0C 00000000 // CHECK-NEXT: ) // CHECK-NEXT: } // CHECK-NEXT: Section { @@ -41,13 +53,15 @@ f: // CHECK-NEXT: Flags [ // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 -// CHECK-NEXT: Offset: 0x3A0 -// CHECK-NEXT: Size: 24 +// CHECK-NEXT: Offset: 0x3C8 +// CHECK-NEXT: Size: 72 // CHECK-NEXT: Link: 7 // CHECK-NEXT: Info: 4 // CHECK-NEXT: AddressAlignment: 8 // CHECK-NEXT: EntrySize: 24 // CHECK-NEXT: Relocations [ // CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0 +// CHECK-NEXT: 0x3C R_X86_64_PC32 .text 0x +// CHECK-NEXT: 0x50 R_X86_64_PC32 .text 0x // CHECK-NEXT: ] // CHECK: } diff --git a/test/MC/ELF/cfi-version.ll b/test/MC/ELF/cfi-version.ll index c8a9978..2f34b2a 100644 --- a/test/MC/ELF/cfi-version.ll +++ b/test/MC/ELF/cfi-version.ll @@ -22,17 +22,17 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !{!"0x11\0012\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/test.c] [DW_LANG_C99] -!1 = !{!"test.c", !"/tmp"} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "test.c", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\002\000\001\000\006\00256\000\002", !1, !5, !6, null, i32 ()* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp/test.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !2) +!5 = !MDFile(filename: "test.c", directory: "/tmp") +!6 = !MDSubroutineType(types: !7) !7 = !{!8} -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{i32 2, !"Dwarf Version", i32 4} -!10 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !{i32 1, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5.0 "} !12 = !MDLocation(line: 2, scope: !4) diff --git a/test/MC/ELF/entsize.ll b/test/MC/ELF/entsize.ll index 2bf9fa9..941a300 100644 --- a/test/MC/ELF/entsize.ll +++ b/test/MC/ELF/entsize.ll @@ -8,10 +8,10 @@ @.c8b = private unnamed_addr constant [1 x i64] [i64 42] 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)) - call void @foo(i64* getelementptr inbounds ([1 x i64]* @.c8a, i32 0, i32 0)) - call void @foo(i64* getelementptr inbounds ([1 x i64]* @.c8b, i32 0, i32 0)) + %1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0)) + %2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i32 0, i32 0)) + call void @foo(i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.c8a, i32 0, i32 0)) + call void @foo(i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.c8b, i32 0, i32 0)) ret i32 0 } diff --git a/test/MC/ELF/gen-dwarf.s b/test/MC/ELF/gen-dwarf.s index 7f0c059..4e773c7 100644 --- a/test/MC/ELF/gen-dwarf.s +++ b/test/MC/ELF/gen-dwarf.s @@ -34,6 +34,7 @@ foo: // ASM: .section .debug_info // ASM: .section .debug_abbrev +// ASM-NEXT: .Lsection_abbrev: // ASM-NEXT: [[ABBREV_LABEL:.Ltmp[0-9]+]] // Second instance of the section has the CU diff --git a/test/MC/ELF/relocation-386.s b/test/MC/ELF/relocation-386.s index 83c524b..b998ea5 100644 --- a/test/MC/ELF/relocation-386.s +++ b/test/MC/ELF/relocation-386.s @@ -65,6 +65,9 @@ // CHECK-NEXT: 0xA3 R_386_GOTOFF und_symbol 0x0 // Relocation 29 (zed@PLT) is of type R_386_PLT32 and uses the symbol // CHECK-NEXT: 0xA9 R_386_PLT32 zed 0x0 +// CHECK-NEXT: 0xAF R_386_PC32 tr_start 0x0 +// CHECK-NEXT: 0xB3 R_386_16 foo 0x0 +// CHECK-NEXT: 0xB5 R_386_8 foo 0x0 // CHECK-NEXT: } // CHECK-NEXT: ] @@ -133,6 +136,12 @@ bar2: leal 1 + und_symbol@GOTOFF, %edi movl zed@PLT(%eax), %eax + .code64 + jmpq *tr_start(%rip) + + .word foo + .byte foo + .section zedsec,"awT",@progbits zed: .long 0 diff --git a/test/MC/ELF/relocation.s b/test/MC/ELF/relocation.s index c0e6007..de2b434 100644 --- a/test/MC/ELF/relocation.s +++ b/test/MC/ELF/relocation.s @@ -34,6 +34,15 @@ bar: movl $_GLOBAL_OFFSET_TABLE_, %eax movabs $_GLOBAL_OFFSET_TABLE_, %rax + .quad blah@SIZE # R_X86_64_SIZE64 + .quad blah@SIZE + 32 # R_X86_64_SIZE64 + .quad blah@SIZE - 32 # R_X86_64_SIZE64 + movl blah@SIZE, %eax # R_X86_64_SIZE32 + movl blah@SIZE + 32, %eax # R_X86_64_SIZE32 + movl blah@SIZE - 32, %eax # R_X86_64_SIZE32 + + .long foo@gotpcrel + .long foo@plt // CHECK: Section { // CHECK: Name: .rela.text // CHECK: Relocations [ @@ -62,6 +71,14 @@ bar: // CHECK-NEXT: 0x98 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFB // CHECK-NEXT: 0x9D R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_ 0x1 // CHECK-NEXT: 0xA3 R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_ 0x2 +// CHECK-NEXT: 0xAB R_X86_64_SIZE64 blah 0x0 +// CHECK-NEXT: 0xB3 R_X86_64_SIZE64 blah 0x20 +// CHECK-NEXT: 0xBB R_X86_64_SIZE64 blah 0xFFFFFFFFFFFFFFE0 +// CHECK-NEXT: 0xC6 R_X86_64_SIZE32 blah 0x0 +// CHECK-NEXT: 0xCD R_X86_64_SIZE32 blah 0x20 +// CHECK-NEXT: 0xD4 R_X86_64_SIZE32 blah 0xFFFFFFFFFFFFFFE0 +// CHECK-NEXT: 0xD8 R_X86_64_GOTPCREL foo 0x0 +// CHECK-NEXT: 0xDC R_X86_64_PLT32 foo 0x0 // CHECK-NEXT: ] // CHECK-NEXT: } diff --git a/test/MC/ELF/size.s b/test/MC/ELF/size.s new file mode 100644 index 0000000..7bbf661 --- /dev/null +++ b/test/MC/ELF/size.s @@ -0,0 +1,15 @@ +// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux < %s | llvm-readobj -t | FileCheck %s + +foo: +bar = . + .size foo, . - bar + 42 + +// CHECK: Symbol { +// CHECK: Name: foo +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 42 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } diff --git a/test/MC/ELF/weak-diff.s b/test/MC/ELF/weak-diff.s new file mode 100644 index 0000000..d270bbb --- /dev/null +++ b/test/MC/ELF/weak-diff.s @@ -0,0 +1,12 @@ +// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t 2>&1 | FileCheck %s + +// CHECK: error: Cannot represent a subtraction with a weak symbol + +.weak f +.weak g +f: + nop +g: + nop + +.quad g - f |