[cfe-commits] r95061 - in /cfe/trunk/test/CodeGenCXX: member-pointers-zero-init.cpp pointers-to-data-members.cpp

Anders Carlsson andersca at mac.com
Mon Feb 1 19:32:36 PST 2010


Author: andersca
Date: Mon Feb  1 21:32:35 2010
New Revision: 95061

URL: http://llvm.org/viewvc/llvm-project?rev=95061&view=rev
Log:
Merge a test into pointers-to-data-members.cpp and convert it to FileCheck.

Removed:
    cfe/trunk/test/CodeGenCXX/member-pointers-zero-init.cpp
Modified:
    cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp

Removed: cfe/trunk/test/CodeGenCXX/member-pointers-zero-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-pointers-zero-init.cpp?rev=95060&view=auto

==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-pointers-zero-init.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/member-pointers-zero-init.cpp (removed)
@@ -1,34 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o %t -triple=x86_64-apple-darwin9
-
-struct A {
-  int i;
-};
-
-// RUN: grep "@a = global i64 -1" %t
-int A::* a;
-
-// RUN: grep "@aa = global \[2 x i64\] \[i64 -1, i64 -1\]" %t
-int A::* aa[2];
-
-// RUN: grep "@aaa = global \[2 x \[2 x i64\]\] \[\[2 x i64\] \[i64 -1, i64 -1\], \[2 x i64\] \[i64 -1, i64 -1\]\]" %t
-int A::* aaa[2][2];
-
-// RUN: grep "@b = global i64 -1" %t
-int A::* b = 0;
-
-void f() {
-  // RUN: grep "%.* = icmp ne i64 %.*, -1" %t | count 2
-  if (a) { }
-  if (a != 0) { }
-
-  // RUN: grep "%.* = icmp ne i64 -1, %.*" %t | count 1
-  if (0 != a) { }
-  
-  // RUN: grep "%.* = icmp eq i64 %.*, -1" %t | count 1
-  if (a == 0) { }
-
-  // RUN: grep "%.* = icmp eq i64 -1, %.*" %t | count 1
-  if (0 == a) { }
-    
-}
-

Modified: cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp?rev=95061&r1=95060&r2=95061&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp Mon Feb  1 21:32:35 2010
@@ -4,6 +4,38 @@
 struct B { int b; };
 struct C : B, A { };
 
+// Zero init.
+namespace ZeroInit {
+  // CHECK: @_ZN8ZeroInit1aE = global i64 -1
+  int A::* a;
+  
+  // CHECK: @_ZN8ZeroInit2aaE = global [2 x i64] [i64 -1, i64 -1]
+  int A::* aa[2];
+  
+  // CHECK: @_ZN8ZeroInit3aaaE = global [2 x [2 x i64]] {{\[}}[2 x i64] [i64 -1, i64 -1], [2 x i64] [i64 -1, i64 -1]]
+  int A::* aaa[2][2];
+  
+  // CHECK: @_ZN8ZeroInit1bE = global i64 -1,
+  int A::* b = 0;
+  
+  void f() {
+    // CHECK: icmp ne i64 {{.*}}, -1
+    if (a) { }
+
+    // CHECK: icmp ne i64 {{.*}}, -1
+    if (a != 0) { }
+    
+    // CHECK: icmp ne i64 -1, {{.*}}
+    if (0 != a) { }
+
+    // CHECK: icmp eq i64 {{.*}}, -1
+    if (a == 0) { }
+
+    // CHECK: icmp eq i64 -1, {{.*}}
+    if (0 == a) { }
+  }
+}
+
 // Casts.
 namespace Casts {
 





More information about the cfe-commits mailing list