mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 20:31:36 +08:00
attr-aligned-2.c: New test.
gcc/testsuite/ChangeLog: * gcc.target/i386/attr-aligned-2.c: New test. * gcc.target/i386/falign-functions-3.c: New test. From-SVN: r266795
This commit is contained in:
parent
f698917d45
commit
565ec4de67
@ -1,3 +1,8 @@
|
||||
2018-12-04 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
* gcc.target/i386/attr-aligned-2.c: New test.
|
||||
* gcc.target/i386/falign-functions-3.c: New test.
|
||||
|
||||
2018-12-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/88188
|
||||
|
26
gcc/testsuite/gcc.target/i386/attr-aligned-2.c
Normal file
26
gcc/testsuite/gcc.target/i386/attr-aligned-2.c
Normal file
@ -0,0 +1,26 @@
|
||||
/* Verify that valid alignment on either a function declaration
|
||||
or a definition has the expected effect and overrides -Os.
|
||||
{ dg-do compile }
|
||||
{ dg-options "-Os" } */
|
||||
|
||||
#define ALIGN(n) __attribute__ ((aligned (n)))
|
||||
|
||||
/* No alignment specified (to cause the subsequent instruction
|
||||
to be at an odd boundary due to -Os). */
|
||||
void f (void) { }
|
||||
|
||||
void f4 (void);
|
||||
|
||||
ALIGN (4)
|
||||
void f4 (void) { }
|
||||
|
||||
/* { dg-final { scan-assembler ".align 4\n\t.globl\tf4" } } */
|
||||
|
||||
|
||||
void g (void) { }
|
||||
|
||||
|
||||
ALIGN (4)
|
||||
void g4 (void);
|
||||
|
||||
void g4 (void) { }
|
23
gcc/testsuite/gcc.target/i386/falign-functions-3.c
Normal file
23
gcc/testsuite/gcc.target/i386/falign-functions-3.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* Verify that attribute aligned overrides the effect of -falign-functions.
|
||||
(But see PR 88345 showing that -Os overrides -falign-functions.)
|
||||
The test may need to be adjusted if/when GCC implements PR 88231.
|
||||
{ dg-do compile }
|
||||
{ dg-options "-O2 -falign-functions=32" } */
|
||||
|
||||
#define ALIGN(n) __attribute__ ((aligned (n)))
|
||||
|
||||
ALIGN (4)
|
||||
void f4 (void) { }
|
||||
|
||||
/* { dg-final { scan-assembler ".align 4\n\t.globl\tf4" } } */
|
||||
|
||||
|
||||
void f32 (void) { }
|
||||
|
||||
/* { dg-final { scan-assembler ".p2align 5\n\t.globl\tf32" } } */
|
||||
|
||||
|
||||
ALIGN (64)
|
||||
void f64 (void) { }
|
||||
|
||||
/* { dg-final { scan-assembler ".align 64\n\t.globl\tf64" } } */
|
Loading…
x
Reference in New Issue
Block a user