diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-02 03:32:35 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-02 03:32:35 +0000 |
commit | 63b071f28ea936772634c176a34de2bf0301f79c (patch) | |
tree | e1ae3ebf3ef27483e0e7a2ef5c170c1ed50c5ef7 | |
parent | fe40456f0c0060097564cecaf7faada39185463a (diff) |
Merge a test into pointers-to-data-members.cpp and convert it to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95061 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGenCXX/member-pointers-zero-init.cpp | 34 | ||||
-rw-r--r-- | test/CodeGenCXX/pointers-to-data-members.cpp | 32 |
2 files changed, 32 insertions, 34 deletions
diff --git a/test/CodeGenCXX/member-pointers-zero-init.cpp b/test/CodeGenCXX/member-pointers-zero-init.cpp deleted file mode 100644 index 18a2ead1ed..0000000000 --- a/test/CodeGenCXX/member-pointers-zero-init.cpp +++ /dev/null @@ -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) { } - -} - diff --git a/test/CodeGenCXX/pointers-to-data-members.cpp b/test/CodeGenCXX/pointers-to-data-members.cpp index 567e3f3740..c34bd5b114 100644 --- a/test/CodeGenCXX/pointers-to-data-members.cpp +++ b/test/CodeGenCXX/pointers-to-data-members.cpp @@ -4,6 +4,38 @@ struct A { int a; }; 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 { |