aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/ELF/align-nops.s
diff options
context:
space:
mode:
authorJan Wen Voung <jvoung@google.com>2010-10-04 17:32:41 +0000
committerJan Wen Voung <jvoung@google.com>2010-10-04 17:32:41 +0000
commit083cf1574facc9ce468fba1735c794bd7e520108 (patch)
tree89bc4a3eeececcf7162c44251e43316055fa47e0 /test/MC/ELF/align-nops.s
parent7a391832f46ca2947f6ee46f6fad53cf64197d28 (diff)
downloadexternal_llvm-083cf1574facc9ce468fba1735c794bd7e520108.zip
external_llvm-083cf1574facc9ce468fba1735c794bd7e520108.tar.gz
external_llvm-083cf1574facc9ce468fba1735c794bd7e520108.tar.bz2
Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO. Also added tests for ELF and COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/ELF/align-nops.s')
-rw-r--r--test/MC/ELF/align-nops.s40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/MC/ELF/align-nops.s b/test/MC/ELF/align-nops.s
new file mode 100644
index 0000000..b6793ec
--- /dev/null
+++ b/test/MC/ELF/align-nops.s
@@ -0,0 +1,40 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
+
+// Test that we get optimal nops in text
+ .text
+f0:
+ .long 0
+ .align 8, 0x90
+ .long 0
+ .align 8
+
+// But not in another section
+ .data
+ .long 0
+ .align 8, 0x90
+ .long 0
+ .align 8
+
+// CHECK: (('sh_name', 1) # '.text'
+// CHECK-NEXT: ('sh_type', 1)
+// CHECK-NEXT: ('sh_flags', 6)
+// CHECK-NEXT: ('sh_addr',
+// CHECK-NEXT: ('sh_offset',
+// CHECK-NEXT: ('sh_size', 16)
+// CHECK-NEXT: ('sh_link', 0)
+// CHECK-NEXT: ('sh_info', 0)
+// CHECK-NEXT: ('sh_addralign', 8)
+// CHECK-NEXT: ('sh_entsize', 0)
+// CHECK-NEXT: ('_section_data', '00000000 0f1f4000 00000000 0f1f4000')
+
+// CHECK: (('sh_name', 7) # '.data'
+// CHECK-NEXT: ('sh_type', 1)
+// CHECK-NEXT: ('sh_flags', 3)
+// CHECK-NEXT: ('sh_addr',
+// CHECK-NEXT: ('sh_offset',
+// CHECK-NEXT: ('sh_size', 16)
+// CHECK-NEXT: ('sh_link', 0)
+// CHECK-NEXT: ('sh_info', 0)
+// CHECK-NEXT: ('sh_addralign', 8)
+// CHECK-NEXT: ('sh_entsize', 0)
+// CHECK-NEXT: ('_section_data', '00000000 90909090 00000000 00000000')