From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- test/CodeGen/tbaa-struct.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/CodeGen/tbaa-struct.cpp (limited to 'test/CodeGen/tbaa-struct.cpp') diff --git a/test/CodeGen/tbaa-struct.cpp b/test/CodeGen/tbaa-struct.cpp new file mode 100644 index 0000000..8b30aa0 --- /dev/null +++ b/test/CodeGen/tbaa-struct.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s +// +// Check that we generate !tbaa.struct metadata for struct copies. +struct A { + short s; + int i; + char c; + int j; +}; + +void copy(struct A *a, struct A *b) { + *a = *b; +} + +// CHECK: target datalayout = "{{.*}}p:[[P:64|32]] +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i[[P]](i8* %{{.*}}, i8* %{{.*}}, i[[P]] 16, i32 4, i1 false), !tbaa.struct [[TS:!.*]] +// CHECK: [[TS]] = metadata !{i64 0, i64 2, metadata !{{.*}}, i64 4, i64 4, metadata !{{.*}}, i64 8, i64 1, metadata !{{.*}}, i64 12, i64 4, metadata !{{.*}}} -- cgit v1.1