[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-struct-align.cpp
blob6d75c71476ba1bb18a409ab11e4f0a57fba758c5
1 // Test for debug info related to DW_AT_alignment attribute in the struct type.
2 // RUN: %clang_cc1 -dwarf-version=5 -debug-info-kind=standalone -S -emit-llvm %s -o - | FileCheck %s
4 // CHECK-DAG: DICompositeType(tag: DW_TAG_structure_type, name: "MyType", {{.*}}, align: 32
5 // CHECK-DAG: DICompositeType(tag: DW_TAG_structure_type, name: "MyType1", {{.*}}, align: 8
6 // CHECK-DAG: DICompositeType(tag: DW_TAG_structure_type, name: "MyType2", {{.*}}, align: 8
8 struct MyType {
9 int m;
10 } __attribute__((aligned(1)));
11 MyType mt;
13 static_assert(alignof(MyType) == 4, "alignof MyType is wrong");
15 struct MyType1 {
16 int m;
17 } __attribute__((packed, aligned(1)));
18 MyType1 mt1;
20 static_assert(alignof(MyType1) == 1, "alignof MyType1 is wrong");
22 struct MyType2 {
23 __attribute__((packed)) int m;
24 } __attribute__((aligned(1)));
25 MyType2 mt2;
27 static_assert(alignof(MyType2) == 1, "alignof MyType2 is wrong");