summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c
new file mode 100644
index 00000000000..cbb4a144418
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c
@@ -0,0 +1,12 @@
+#include <stdint.h>
+
+struct Foo {
+ int8_t a;
+ int16_t b;
+};
+
+int main (int argc, char const *argv[]) {
+ struct Foo f;
+ return f.a; //% self.expect("expr offsetof(Foo, a)", substrs = ['= 0'])
+ //% self.expect("expr offsetof(Foo, b)", substrs = ['= 2'])
+}
OpenPOWER on IntegriCloud