From bbc0aa516623f73d606783a2e4594c50fed4a830 Mon Sep 17 00:00:00 2001 From: Charles Davis Date: Wed, 10 Feb 2010 23:06:52 +0000 Subject: 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 --- clang/test/Sema/x86-attr-force-align-arg-pointer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 clang/test/Sema/x86-attr-force-align-arg-pointer.c (limited to 'clang/test/Sema/x86-attr-force-align-arg-pointer.c') 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)(); + -- cgit v1.2.3