llvm-project/clang/test/Sema/x86-attr-force-align-arg-pointer.c
Aaron Ballman 22db4824b9 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the third batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-07 09:25:01 -05:00

22 lines
855 B
C

// RUN: %clang_cc1 -triple i386-apple-darwin10 -fsyntax-only -verify %s
int a __attribute__((force_align_arg_pointer)); // expected-warning{{attribute only applies to functions}}
// 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)(void);
typedef void (__attribute__((__force_align_arg_pointer__)) *p2)(void);
// Attribute is also ignored on function typedefs.
typedef void __attribute__((force_align_arg_pointer)) e(void);