diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-30 19:55:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-30 19:55:07 +0000 |
commit | a67810e1c1102b7e1e9d6783be24941950949689 (patch) | |
tree | 1c622eb9d414c3758fdcd0aaa74a8de2d1dc9150 | |
parent | 30a46b54f12c24fba6bb731e859da290525fd793 (diff) |
Convert from nonportable grep to filecheck, patch by John Thompson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83158 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/address-space-field1.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/CodeGen/address-space-field1.c b/test/CodeGen/address-space-field1.c index e7c655a8fe..f9da5f413f 100644 --- a/test/CodeGen/address-space-field1.c +++ b/test/CodeGen/address-space-field1.c @@ -1,6 +1,25 @@ -// RUN: clang-cc -emit-llvm < %s -o %t && -// RUN: grep addrspace\(1\) %t | count 9 && -// RUN: grep addrspace\(2\) %t | count 9 +// RUN: clang-cc -emit-llvm < %s -o - | FileCheck %s +// CHECK:%struct.S = type { i32, i32 } +// CHECK:define void @test_addrspace(%struct.S addrspace(1)* %p1, %struct.S addrspace(2)* %p2) nounwind { +// CHECK:entry: +// CHECK: %p1.addr = alloca %struct.S addrspace(1)* ; <%struct.S addrspace(1)**> [#uses=3] +// CHECK: %p2.addr = alloca %struct.S addrspace(2)* ; <%struct.S addrspace(2)**> [#uses=3] +// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** %p1.addr +// CHECK: store %struct.S addrspace(2)* %p2, %struct.S addrspace(2)** %p2.addr +// CHECK: %tmp = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1] +// CHECK: %tmp1 = getelementptr inbounds %struct.S addrspace(2)* %tmp, i32 0, i32 1 ; <i32 addrspace(2)*> [#uses=1] +// CHECK: %tmp2 = load i32 addrspace(2)* %tmp1 ; <i32> [#uses=1] +// CHECK: %tmp3 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1] +// CHECK: %tmp4 = getelementptr inbounds %struct.S addrspace(1)* %tmp3, i32 0, i32 0 ; <i32 addrspace(1)*> [#uses=1] +// CHECK: store i32 %tmp2, i32 addrspace(1)* %tmp4 +// CHECK: %tmp5 = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1] +// CHECK: %tmp6 = getelementptr inbounds %struct.S addrspace(2)* %tmp5, i32 0, i32 0 ; <i32 addrspace(2)*> [#uses=1] +// CHECK: %tmp7 = load i32 addrspace(2)* %tmp6 ; <i32> [#uses=1] +// CHECK: %tmp8 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1] +// CHECK: %tmp9 = getelementptr inbounds %struct.S addrspace(1)* %tmp8, i32 0, i32 1 ; <i32 addrspace(1)*> [#uses=1] +// CHECK: store i32 %tmp7, i32 addrspace(1)* %tmp9 +// CHECK: ret void +// CHECK:} // Check that we don't lose the address space when accessing a member // of a structure. |