]> granicus.if.org Git - clang/commitdiff
Turn test for // rdar://8945175 into a sema test.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 2 Feb 2011 21:10:07 +0000 (21:10 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 2 Feb 2011 21:10:07 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124748 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/non-empty-class-size-zero.cpp [deleted file]
test/SemaCXX/non-empty-class-size-zero.cpp [new file with mode: 0644]

diff --git a/test/CodeGenCXX/non-empty-class-size-zero.cpp b/test/CodeGenCXX/non-empty-class-size-zero.cpp
deleted file mode 100644 (file)
index 810717b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
-// rdar://8945175
-
-struct X { 
-  int array[0]; 
-  int array1[0]; 
-  int array2[0]; 
-  X();
-  ~X();
-};
-
-struct Y {
-  int first;
-  X padding;
-  int second;
-};
-
-int main() {
-// CHECK: store i32 0, i32* [[RETVAL:%.*]]
-  return sizeof(Y) -8 ;
-}
diff --git a/test/SemaCXX/non-empty-class-size-zero.cpp b/test/SemaCXX/non-empty-class-size-zero.cpp
new file mode 100644 (file)
index 0000000..6b714db
--- /dev/null
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only %s
+// rdar://8945175
+
+struct X { 
+  int array[0]; 
+  int array1[0]; 
+  int array2[0]; 
+  X();
+  ~X();
+};
+
+struct Y {
+  int first;
+  X padding;
+  int second;
+};
+
+int zero_size_array[(sizeof(Y)  == 8) -1]; // no error here!