// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unk-unk -emit-llvm -Os -o %t %s
// RUN: FileCheck < %t %s
;
;
;
;
// CHECK: @align0 ={{.*}} local_unnamed_addr global i32 1
int align0 = ;
// CHECK: @align1 ={{.*}} local_unnamed_addr global i32 4
int align1 = ;
// CHECK: @align2 ={{.*}} local_unnamed_addr global i32 1
int align2 = ;
// CHECK: @align3 ={{.*}} local_unnamed_addr global i32 1
int align3 = ;
// CHECK: @align0_x ={{.*}} local_unnamed_addr global i32 1
int align0_x = ;
//
// CHECK: @align1_x ={{.*}} local_unnamed_addr global i32 1
int align1_x = ;
// CHECK: @align2_x ={{.*}} local_unnamed_addr global i32 1
int align2_x = ;
// CHECK: @align3_x ={{.*}} local_unnamed_addr global i32 1
int align3_x = ;
// CHECK: @align0_x0 ={{.*}} local_unnamed_addr global i32 4
int align0_x0 = ;
// CHECK: @align1_x0 ={{.*}} local_unnamed_addr global i32 4
int align1_x0 = ;
// CHECK: @align2_x0 ={{.*}} local_unnamed_addr global i32 4
int align2_x0 = ;
// CHECK: @align3_x0 ={{.*}} local_unnamed_addr global i32 4
int align3_x0 = ;
// CHECK-LABEL: define{{.*}} i32 @f0_a
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f0_b
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
int
int
// Note that 'y' still causes struct s1 to be four-byte aligned.
// Note that we are incompatible with GCC on this example.
//
// CHECK-LABEL: define{{.*}} i32 @f1_a
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f1_b
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
// Note that we are incompatible with GCC on this example.
//
// CHECK-LABEL: define{{.*}} i32 @f1_c
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f1_d
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
int
int
int
int
// CHECK-LABEL: define{{.*}} i32 @f2_a
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f2_b
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f2_c
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f2_d
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
int
int
int
int
// CHECK-LABEL: define{{.*}} i32 @f3_a
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f3_b
// CHECK: load i32, i32* %{{.*}}, align 4
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f3_c
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
// CHECK-LABEL: define{{.*}} i32 @f3_d
// CHECK: load i32, i32* %{{.*}}, align 1
// CHECK: }
int
int
int
int
// Verify we don't claim things are overaligned.
//
// CHECK-LABEL: define{{.*}} double @f4
// CHECK: load double, double* {{.*}}, align 8
// CHECK: }
extern double g4 ;
double