diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-20 18:08:57 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-20 18:08:57 +0000 |
| commit | 6b07a1c6ee50dcf4d52a4a314b4774347f9b22c0 (patch) | |
| tree | 4cc8c21d84f5ad56ef4c8addf953a1cab14f5b5b /clang/test/CodeGen/funique-sections.c | |
| parent | 5c56fb55b0857181d7bb89c40cce9d87c0942c00 (diff) | |
| download | bcm5719-llvm-6b07a1c6ee50dcf4d52a4a314b4774347f9b22c0.tar.gz bcm5719-llvm-6b07a1c6ee50dcf4d52a4a314b4774347f9b22c0.zip | |
Add -funique-section-names and -fno-unique-section-names options.
For now -funique-section-names is the default, so no change in default behavior.
The total .o size in a build of llvm and clang goes from 241687775 to 230649031
bytes if -fno-unique-section-names is used.
llvm-svn: 230031
Diffstat (limited to 'clang/test/CodeGen/funique-sections.c')
| -rw-r--r-- | clang/test/CodeGen/funique-sections.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/funique-sections.c b/clang/test/CodeGen/funique-sections.c new file mode 100644 index 00000000000..1473fe57db0 --- /dev/null +++ b/clang/test/CodeGen/funique-sections.c @@ -0,0 +1,13 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cc1 -triple x86_64-pc-linux -S -ffunction-sections -fdata-sections -fno-unique-section-names -o - < %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-linux -S -ffunction-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=UNIQUE + +const int hello = 123; +void world() {} + +// CHECK: .section .text,"ax",@progbits,unique +// CHECK: .section .rodata,"a",@progbits,unique + +// UNIQUE: .section .text.world,"ax",@progbits +// UNIQUE: .section .rodata.hello,"a",@progbits |

