From 7b69956387785006244e7868f8dab09b371dbb6d Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 29 Sep 2009 03:38:56 +0000 Subject: [PATCH] Forgot test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83044 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/member-function-pointers.cpp | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/CodeGenCXX/member-function-pointers.cpp diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp new file mode 100644 index 0000000000..9f322a75ec --- /dev/null +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -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; +}