// TLS variable cannot be aligned to more than 32 bytes on PS4.
// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fsyntax-only -verify %s
// A non-aligned type.
;
// An aligned type.
;
// A type with an aligned field.
;
// A typedef of the aligned struct.
typedef aligned_struct another_aligned_struct;
// A typedef to redefine a non-aligned struct as aligned.
typedef non_aligned_struct yet_another_aligned_struct;
// Non aligned variable doesn't cause an error.
__thread non_aligned_struct foo;
// Variable aligned because of its type should cause an error.
__thread aligned_struct bar; // expected-error{{alignment (64) of thread-local variable}}
// Variable explicitly aligned in the declaration should cause an error.
__thread non_aligned_struct bar2 ; // expected-error{{alignment (64) of thread-local variable}}
// Variable aligned because of one of its fields should cause an error.
__thread struct_with_aligned_field bar3; // expected-error{{alignment (64) of thread-local variable}}
// Variable aligned because of typedef, first case.
__thread another_aligned_struct bar4; // expected-error{{alignment (64) of thread-local variable}}
// Variable aligned because of typedef, second case.
__thread yet_another_aligned_struct bar5; // expected-error{{alignment (64) of thread-local variable}}
int
// Verify alignment check where a dependent type is involved.
// The check is (correctly) not performed on "t", but the check still is
// performed on the structure as a whole once it has been instantiated.
;
__thread templated_tls<int> blah; // expected-error{{alignment (64) of thread-local variable}}
int
// Verify alignment check where the alignment is a template parameter.
// The check is only performed during instantiation.
;
S<64> s_instance; // expected-note{{in instantiation of template class 'S<64>' requested here}}