33 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3typedef double * __attribute__((align_value(64))) aligned_double;4 5void foo(aligned_double x, double * y __attribute__((align_value(32)))) { };6 7// expected-error@+1 {{requested alignment is not a power of 2}}8typedef double * __attribute__((align_value(63))) aligned_double1;9 10// expected-error@+1 {{requested alignment is not a power of 2}}11typedef double * __attribute__((align_value(-2))) aligned_double2;12 13// expected-error@+1 {{attribute takes one argument}}14typedef double * __attribute__((align_value(63, 4))) aligned_double3;15 16// expected-error@+1 {{attribute takes one argument}}17typedef double * __attribute__((align_value())) aligned_double3a;18 19// expected-error@+1 {{attribute takes one argument}}20typedef double * __attribute__((align_value)) aligned_double3b;21 22// expected-error@+1 {{'align_value' attribute requires integer constant}}23typedef double * __attribute__((align_value(4.5))) aligned_double4;24 25// expected-warning@+1 {{'align_value' attribute only applies to a pointer or reference ('int' is invalid)}}26typedef int __attribute__((align_value(32))) aligned_int;27 28typedef double * __attribute__((align_value(32*2))) aligned_double5;29 30// expected-warning@+1 {{'align_value' attribute only applies to variables and typedefs}}31void bar(void) __attribute__((align_value(32)));32 33