Changeset View
Changeset View
Standalone View
Standalone View
clang/test/Sema/builtin-assume-aligned.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
void *test_no_fn_proto() __attribute__((assume_aligned(31))); // expected-error {{requested alignment is not a power of 2}} | void *test_no_fn_proto() __attribute__((assume_aligned(31))); // expected-error {{requested alignment is not a power of 2}} | ||||
void *test_no_fn_proto() __attribute__((assume_aligned(32, 73))); // no-warning | void *test_no_fn_proto() __attribute__((assume_aligned(32, 73))); // no-warning | ||||
void *test_no_fn_proto() __attribute__((assume_aligned)); // expected-error {{'assume_aligned' attribute takes at least 1 argument}} | void *test_no_fn_proto() __attribute__((assume_aligned)); // expected-error {{'assume_aligned' attribute takes at least 1 argument}} | ||||
void *test_no_fn_proto() __attribute__((assume_aligned())); // expected-error {{'assume_aligned' attribute takes at least 1 argument}} | void *test_no_fn_proto() __attribute__((assume_aligned())); // expected-error {{'assume_aligned' attribute takes at least 1 argument}} | ||||
void *test_no_fn_proto() __attribute__((assume_aligned(32, 45, 37))); // expected-error {{'assume_aligned' attribute takes no more than 2 arguments}} | void *test_no_fn_proto() __attribute__((assume_aligned(32, 45, 37))); // expected-error {{'assume_aligned' attribute takes no more than 2 arguments}} | ||||
int pr43638(int *a) { | |||||
a = __builtin_assume_aligned(a, 4294967296); // expected-warning {{requested alignment must be %0 bytes or smaller; assumption ignored}} | |||||
return a[0]; | |||||
} |