diff options
author | Charles Davis <cdavis@mines.edu> | 2010-02-10 23:06:52 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2010-02-10 23:06:52 +0000 |
commit | bbc0aa516623f73d606783a2e4594c50fed4a830 (patch) | |
tree | 3ab7b4c3231fc5c8752724b80a7f054d4c29baa2 /clang/test/Sema/x86-attr-force-align-arg-pointer.c | |
parent | af3fe9982116fe772960fa5fcfd05caaf9a7ba32 (diff) | |
download | bcm5719-llvm-bbc0aa516623f73d606783a2e4594c50fed4a830.tar.gz bcm5719-llvm-bbc0aa516623f73d606783a2e4594c50fed4a830.zip |
Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.
llvm-svn: 95820
Diffstat (limited to 'clang/test/Sema/x86-attr-force-align-arg-pointer.c')
-rw-r--r-- | clang/test/Sema/x86-attr-force-align-arg-pointer.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Sema/x86-attr-force-align-arg-pointer.c b/clang/test/Sema/x86-attr-force-align-arg-pointer.c new file mode 100644 index 00000000000..1470544a697 --- /dev/null +++ b/clang/test/Sema/x86-attr-force-align-arg-pointer.c @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fsyntax-only -verify %s + +int a __attribute__((force_align_arg_pointer)); // expected-warning{{attribute only applies to function types}} + +// It doesn't matter where the attribute is located. +void b(void) __attribute__((force_align_arg_pointer)); +void __attribute__((force_align_arg_pointer)) c(void); + +// Functions only have to be declared force_align_arg_pointer once. +void b(void) {} + +// It doesn't matter which declaration has the attribute. +void d(void); +void __attribute__((force_align_arg_pointer)) d(void) {} + +// Attribute is ignored on function pointer types. +void (__attribute__((force_align_arg_pointer)) *p)(); + |