summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/2008-08-07-GEPIntToPtr.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/2008-08-07-GEPIntToPtr.c')
-rw-r--r--clang/test/CodeGen/2008-08-07-GEPIntToPtr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/2008-08-07-GEPIntToPtr.c b/clang/test/CodeGen/2008-08-07-GEPIntToPtr.c
new file mode 100644
index 0000000..6892be0
--- /dev/null
+++ b/clang/test/CodeGen/2008-08-07-GEPIntToPtr.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// PR2603
+
+struct A {
+ char num_fields;
+};
+
+struct B {
+ char a, b[1];
+};
+
+const struct A Foo = {
+ // CHECK: i8 1
+ (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16)
+};