diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-06-27 00:01:33 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-06-27 00:01:33 +0000 |
commit | 2004d3ba7cacfc09b75adbca502c41b8b593f73d (patch) | |
tree | 23af64cc39624df749ee6d1bacb411a3ce83ad56 | |
parent | 77731b4909c12fae2fa47469335f986f0180640e (diff) | |
download | bcm5719-llvm-2004d3ba7cacfc09b75adbca502c41b8b593f73d.tar.gz bcm5719-llvm-2004d3ba7cacfc09b75adbca502c41b8b593f73d.zip |
Add original source code to test case as suggested in review.
llvm-svn: 240863
-rw-r--r-- | llvm/test/DebugInfo/X86/debug-info-packed-struct.ll | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll b/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll index 614c1608fc8..6829c2d1374 100644 --- a/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll +++ b/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll @@ -7,6 +7,19 @@ target triple = "x86_64-apple-darwin" ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s ; REQUIRES: object-emission +; // --------------------------------------------------------------------- +; // Not packed. +; // --------------------------------------------------------------------- +; struct size8 { +; int i : 4; +; long long l : 60; +; }; +; struct layout0 { +; char l0_ofs0; +; struct size8 l0_ofs8; +; int l0_ofs16 : 1; +; } l0; + %struct.layout0 = type { i8, %struct.size8, i8 } %struct.size8 = type { i64 } ; CHECK: DW_TAG_structure_type @@ -24,6 +37,20 @@ target triple = "x86_64-apple-darwin" ; CHECK: DW_AT_bit_offset {{.*}} (0x1f) ; CHECK: DW_AT_data_member_location {{.*}}10 + +; // --------------------------------------------------------------------- +; // Implicitly packed. +; // --------------------------------------------------------------------- +; struct size8_anon { +; int : 4; +; long long : 60; +; }; +; struct layout1 { +; char l1_ofs0; +; struct size8_anon l1_ofs1; +; int l1_ofs9 : 1; +; } l1; + %struct.layout1 = type <{ i8, %struct.size8_anon, i8, [2 x i8] }> %struct.size8_anon = type { i64 } @@ -43,6 +70,21 @@ target triple = "x86_64-apple-darwin" ; CHECK: DW_AT_bit_offset {{.*}} (0x17) ; CHECK: DW_AT_data_member_location {{.*}}08 +; // --------------------------------------------------------------------- +; // Explicitly packed. +; // --------------------------------------------------------------------- +; #pragma pack(1) +; struct size8_pack1 { +; int i : 4; +; long long l : 60; +; }; +; struct layout2 { +; char l2_ofs0; +; struct size8_pack1 l2_ofs1; +; int l2_ofs9 : 1; +; } l2; +; #pragma pack() + %struct.layout2 = type <{ i8, %struct.size8_pack1, i8 }> %struct.size8_pack1 = type { i64 } @@ -62,6 +104,22 @@ target triple = "x86_64-apple-darwin" ; CHECK: DW_AT_bit_offset {{.*}} (0x17) ; CHECK: DW_AT_data_member_location {{.*}}08 +; // --------------------------------------------------------------------- +; // Explicitly packed with different alignment. +; // --------------------------------------------------------------------- +; #pragma pack(4) +; struct size8_pack4 { +; int i : 4; +; long long l : 60; +; }; +; struct layout3 { +; char l3_ofs0; +; struct size8_pack4 l3_ofs4; +; int l3_ofs12 : 1; +; } l 3; +; #pragma pack() + + %struct.layout3 = type <{ i8, [3 x i8], %struct.size8_pack4, i8, [3 x i8] }> %struct.size8_pack4 = type { i64 } |