From b401e07df06e88dc144a5ebb8e01ac70d84baf5c Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 28 Jun 2010 17:43:18 +0000 Subject: [PATCH] tests: Rewrite test to check intent instead of implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107024 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/DynArrayInit.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/test/CodeGenCXX/DynArrayInit.cpp b/test/CodeGenCXX/DynArrayInit.cpp index d93c64d5a1..4b4c2ecf1d 100644 --- a/test/CodeGenCXX/DynArrayInit.cpp +++ b/test/CodeGenCXX/DynArrayInit.cpp @@ -1,16 +1,15 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s // PR7490 -int main() { - // CHECK: {{for.cond:|:4}} - // CHECK: %{{.*}} = icmp ult i64 %{{.*}}, 1133 - // CHECK: {{for.body:|:6}} - // CHECK: store i8 0 - // CHECK: br label %{{for.inc|7}} - // CHECK: {{for.inc:|:7}} - // CHECK: %{{.*}} = add i64 %{{.*}}, 1 - // CHECK: store i64 %{{.*}} - // CHECK: br label %{{for.cond|4}} - // CHECK: {{for.end:|:12}} - volatile char *buckets = new char[1133](); +// CHECK: define signext i8 @_Z2f0v +// CHECK: ret i8 0 +// CHECK: } +inline void* operator new[](unsigned long, void* __p) { return __p; } +static void f0_a(char *a) { + new (a) char[4](); +} +char f0() { + char a[4]; + f0_a(a); + return a[0] + a[1] + a[2] + a[3]; } -- 2.40.0