From b85695d94b8aa2679e28278ed5ae63074770173c Mon Sep 17 00:00:00 2001 From: Yunzhong Gao Date: Mon, 14 Oct 2013 22:51:23 +0000 Subject: [PATCH] Adding a regression test for PR17578. It is marked xfail until the bug is fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192638 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/offsetof.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/CodeGenCXX/offsetof.cpp diff --git a/test/CodeGenCXX/offsetof.cpp b/test/CodeGenCXX/offsetof.cpp new file mode 100644 index 0000000000..7e257e6af9 --- /dev/null +++ b/test/CodeGenCXX/offsetof.cpp @@ -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); +} -- 2.40.0