// RUN: %clang_cc1 -malign-double -triple i386-unknown-linux -emit-llvm %s -o - \
// RUN: | FileCheck --check-prefix=CHECK-ON --check-prefix=CHECK %s
// RUN: %clang_cc1 -triple i386-unknown-linux -emit-llvm %s -o - \
// RUN: | FileCheck --check-prefix=CHECK-OFF --check-prefix=CHECK %s
/* Structs S1, S2, S3, S4, and union U5 are taken from Intel, "IA-64
Software Conventions and Runtime Architecture Guide", version of
August 1999, Section 4.2, Figures 4-1 through 4-5.
A Union containing a double was also thrown in for good measure. */
;
unsigned S1_align = ;
unsigned S1_size = sizeof;
// CHECK: @S1_align ={{.*}} global i32 1, align 4
// CHECK: @S1_size ={{.*}} global i32 1, align 4
unsigned S1_c_offset = &->c;
// CHECK: @S1_c_offset ={{.*}} global i32 0, align 4
;
unsigned S2_align = ;
unsigned S2_size = sizeof;
// CHECK: @S2_align ={{.*}} global i32 4, align 4
// CHECK: @S2_size ={{.*}} global i32 8, align 4
unsigned S2_c_offset = &->c;
unsigned S2_d_offset = &->d;
unsigned S2_s_offset = &->s;
unsigned S2_n_offset = &->n;
// CHECK: @S2_c_offset ={{.*}} global i32 0, align 4
// CHECK: @S2_d_offset ={{.*}} global i32 1, align 4
// CHECK: @S2_s_offset ={{.*}} global i32 2, align 4
// CHECK: @S2_n_offset ={{.*}} global i32 4, align 4
;
unsigned S3_align = ;
unsigned S3_size = sizeof;
// CHECK: @S3_align ={{.*}} global i32 2, align 4
// CHECK: @S3_size ={{.*}} global i32 4, align 4
unsigned S3_c_offset = &->c;
unsigned S3_s_offset = &->s;
// CHECK: @S3_c_offset ={{.*}} global i32 0, align 4
// CHECK: @S3_s_offset ={{.*}} global i32 2, align 4
;
unsigned S4_align = ;
unsigned S4_size = sizeof;
// CHECK-ON: @S4_align ={{.*}} global i32 8, align 4
// CHECK-ON: @S4_size ={{.*}} global i32 24, align 4
// CHECK-OFF: @S4_align ={{.*}} global i32 4, align 4
// CHECK-OFF: @S4_size ={{.*}} global i32 16, align 4
unsigned S4_c_offset = &->c;
unsigned S4_d_offset = &->d;
unsigned S4_s_offset = &->s;
// CHECK: @S4_c_offset ={{.*}} global i32 0, align 4
// CHECK-ON: @S4_d_offset ={{.*}} global i32 8, align 4
// CHECK-ON: @S4_s_offset ={{.*}} global i32 16, align 4
// CHECK-OFF: @S4_d_offset ={{.*}} global i32 4, align 4
// CHECK-OFF: @S4_s_offset ={{.*}} global i32 12, align 4
;
unsigned S5_align = ;
unsigned S5_size = sizeof;
// CHECK: @S5_align ={{.*}} global i32 4, align 4
// CHECK: @S5_size ={{.*}} global i32 4, align 4
unsigned S5_c_offset = &->c;
unsigned S5_s_offset = &->s;
unsigned S5_j_offset = &->j;
// CHECK: @S5_c_offset ={{.*}} global i32 0, align 4
// CHECK: @S5_s_offset ={{.*}} global i32 0, align 4
// CHECK: @S5_j_offset ={{.*}} global i32 0, align 4
;
unsigned S6_align = ;
unsigned S6_size = sizeof;
// CHECK-ON: @S6_align ={{.*}} global i32 8, align 4
// CHECK-ON: @S6_size ={{.*}} global i32 8, align 4
// CHECK-OFF: @S6_align ={{.*}} global i32 4, align 4
// CHECK-OFF: @S6_size ={{.*}} global i32 8, align 4
unsigned S6_c_offset = &->c;
unsigned S6_d_offset = &->d;
// CHECK: @S6_c_offset ={{.*}} global i32 0, align 4
// CHECK: @S6_d_offset ={{.*}} global i32 0, align 4