aboutsummaryrefslogtreecommitdiff
path: root/test/Modules/module-private.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-13 15:37:05 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-13 15:37:05 +0000
commitfe522c20516878927e4f90a2aeafeeba2ea31c71 (patch)
tree9b9c199918c44fb0220157bf6384bfdf13f2cc83 /test/Modules/module-private.cpp
parentc985b88efc9188845952ab524fe6d4717705257b (diff)
Add a struct-size check for modules when dealing with module-private fields
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/module-private.cpp')
-rw-r--r--test/Modules/module-private.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/Modules/module-private.cpp b/test/Modules/module-private.cpp
index 539e591e09..81b2aca3fb 100644
--- a/test/Modules/module-private.cpp
+++ b/test/Modules/module-private.cpp
@@ -43,7 +43,7 @@ inline void test_f0_in_right() {
struct VisibleStruct {
__module_private__ int field;
- __module_private__ void setField(int f);
+ __module_private__ virtual void setField(int f);
};
#else
@@ -129,4 +129,12 @@ void local_var_private(__module_private__ int param) { // expected-error{{parame
typedef __module_private__ int local_typedef; // expected-error{{typedef 'local_typedef' cannot be declared __module_private__}}
}
+
+// Check struct size
+struct LikeVisibleStruct {
+ int field;
+ virtual void setField(int f);
+};
+
+int check_struct_size[sizeof(VisibleStruct) == sizeof(LikeVisibleStruct)? 1 : -1];
#endif