[cfe-commits] r83044 - /cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp
Anders Carlsson
andersca at mac.com
Mon Sep 28 20:38:56 PDT 2009
Author: andersca
Date: Mon Sep 28 22:38:56 2009
New Revision: 83044
URL: http://llvm.org/viewvc/llvm-project?rev=83044&view=rev
Log:
Forgot test.
Added:
cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp
Added: cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp?rev=83044&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/member-function-pointers.cpp Mon Sep 28 22:38:56 2009
@@ -0,0 +1,25 @@
+// RUN: clang-cc %s -emit-llvm -o - -triple=x86_64-apple-darwin9 -O2 | FileCheck %s
+
+struct A { int a; };
+struct B { int b; };
+struct C : B, A { };
+
+void (A::*pa)();
+void (A::*volatile vpa)();
+void (B::*pb)();
+void (C::*pc)();
+
+
+void f() {
+ // CHECK: store i64 0, i64* getelementptr inbounds (%0* @pa, i64 0, i32 0)
+ // CHECK: store i64 0, i64* getelementptr inbounds (%0* @pa, i64 0, i32 1)
+ pa = 0;
+
+ // CHECK: volatile store i64 0, i64* getelementptr inbounds (%0* @vpa, i64 0, i32 0)
+ // CHECK: volatile store i64 0, i64* getelementptr inbounds (%0* @vpa, i64 0, i32 1)
+ vpa = 0;
+
+ // CHECK: store i64 0, i64* getelementptr inbounds (%0* @pc, i64 0, i32 0)
+ // CHECK: store i64 4, i64* getelementptr inbounds (%0* @pc, i64 0, i32 1)
+ pc = pa;
+}
More information about the cfe-commits
mailing list