summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-28 17:43:26 +0000
committerZachary Turner <zturner@google.com>2015-10-28 17:43:26 +0000
commitc432c8f856e0bd84de980a9d9bb2d31b06fa95b1 (patch)
tree4efa528e074a6e2df782345e4cd97f5d85d038c4 /lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
parenta8a3bd210086b50242903ed95048fe5e53897878 (diff)
downloadbcm5719-llvm-c432c8f856e0bd84de980a9d9bb2d31b06fa95b1.tar.gz
bcm5719-llvm-c432c8f856e0bd84de980a9d9bb2d31b06fa95b1.zip
Move lldb/test to lldb/packages/Python/lldbsuite/test.
This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
new file mode 100644
index 00000000000..26c0176d759
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
@@ -0,0 +1,67 @@
+//===-- main.c --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdint.h>
+#include <stdio.h>
+int main (int argc, char const *argv[])
+{
+ struct Bits
+ {
+ uint32_t : 1, // Unnamed bitfield
+ b1 : 1,
+ b2 : 2,
+ : 2, // Unnamed bitfield
+ b3 : 3,
+ : 2, // Unnamed bitfield (this will get removed)
+ b4 __attribute__ ((aligned(16))),
+ b5 : 5,
+ b6 : 6,
+ b7 : 7,
+ four : 4;
+ };
+
+ printf("%lu", sizeof(struct Bits));
+
+ struct Bits bits;
+ int i;
+ for (i=0; i<(1<<1); i++)
+ bits.b1 = i; //// break $source:$line
+ for (i=0; i<(1<<2); i++)
+ bits.b2 = i; //// break $source:$line
+ for (i=0; i<(1<<3); i++)
+ bits.b3 = i; //// break $source:$line
+ for (i=0; i<(1<<4); i++)
+ bits.b4 = i; //// break $source:$line
+ for (i=0; i<(1<<5); i++)
+ bits.b5 = i; //// break $source:$line
+ for (i=0; i<(1<<6); i++)
+ bits.b6 = i; //// break $source:$line
+ for (i=0; i<(1<<7); i++)
+ bits.b7 = i; //// break $source:$line
+ for (i=0; i<(1<<4); i++)
+ bits.four = i; //// break $source:$line
+
+ struct MoreBits
+ {
+ uint32_t a : 3;
+ uint8_t : 1;
+ uint8_t b : 1;
+ uint8_t c : 1;
+ uint8_t d : 1;
+ };
+
+ struct MoreBits more_bits;
+
+ more_bits.a = 3;
+ more_bits.b = 0;
+ more_bits.c = 1;
+ more_bits.d = 0;
+
+ return 0; //// Set break point at this line.
+
+}
OpenPOWER on IntegriCloud