From 4c8b24812ddcd1dedaca343a6d4e76f91f398981 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Wed, 14 Oct 2009 18:03:49 +0000 Subject: Update clang to r84119. --- test/CodeGenCXX/member-pointers-zero-init.cpp | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/CodeGenCXX/member-pointers-zero-init.cpp (limited to 'test/CodeGenCXX/member-pointers-zero-init.cpp') diff --git a/test/CodeGenCXX/member-pointers-zero-init.cpp b/test/CodeGenCXX/member-pointers-zero-init.cpp new file mode 100644 index 0000000000000..e7b0fdafba6a3 --- /dev/null +++ b/test/CodeGenCXX/member-pointers-zero-init.cpp @@ -0,0 +1,34 @@ +// RUN: clang-cc -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) { } + +} + -- cgit v1.2.3