File tree Expand file tree Collapse file tree 2 files changed +13
-32
lines changed Expand file tree Collapse file tree 2 files changed +13
-32
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ void func (void)
25
25
s = es ;
26
26
}
27
27
28
+ // Test that a global variable with an incomplete type gets the minimum
29
+ // alignment of 2 per the ABI if no alignment was specified by user.
30
+ //
31
+ // CHECK-DAG: @VarNoAl {{.*}} align 2
32
+ // CHECK-DAG: @VarExplAl1 {{.*}} align 1
33
+ // CHECK-DAG: @VarExplAl4 {{.*}} align 4
34
+ struct incomplete_ty ;
35
+ extern struct incomplete_ty VarNoAl ;
36
+ extern struct incomplete_ty __attribute__((aligned (1 ))) VarExplAl1 ;
37
+ extern struct incomplete_ty __attribute__((aligned (4 ))) VarExplAl4 ;
38
+ struct incomplete_ty * fun0 (void ) { return & VarNoAl ; }
39
+ struct incomplete_ty * fun1 (void ) { return & VarExplAl1 ; }
40
+ struct incomplete_ty * fun2 (void ) { return & VarExplAl4 ; }
28
41
29
42
// The SystemZ ABI aligns __int128_t to only eight bytes.
30
43
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments