]> granicus.if.org Git - clang/commitdiff
Adding a regression test for PR17578. It is marked xfail until the bug is fixed.
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Mon, 14 Oct 2013 22:51:23 +0000 (22:51 +0000)
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Mon, 14 Oct 2013 22:51:23 +0000 (22:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192638 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/offsetof.cpp [new file with mode: 0644]

diff --git a/test/CodeGenCXX/offsetof.cpp b/test/CodeGenCXX/offsetof.cpp
new file mode 100644 (file)
index 0000000..7e257e6
--- /dev/null
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm -x c++ < %s
+// XFAIL: *
+
+// PR17578
+struct Base {
+  int a;
+};
+struct Derived : virtual Base
+{};
+
+void foo()
+{
+ int xx = __builtin_offsetof(Derived, a);
+}