36 lines · plain
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s2 3target datalayout = "p:32:32:32-p1:32:32:32-p2:16:16:16"4 5declare void @foo(i32) nounwind6 7; None of these functions should be merged8 9define i32 @store_as0(ptr %x) {10; CHECK-LABEL: @store_as0(11; CHECK: call void @foo(12 %gep = getelementptr i32, ptr %x, i32 413 %y = load i32, ptr %gep14 call void @foo(i32 %y) nounwind15 ret i32 %y16}17 18define i32 @store_as1(ptr addrspace(1) %x) {19; CHECK-LABEL: @store_as1(20; CHECK: call void @foo(21 %gep = getelementptr i32, ptr addrspace(1) %x, i32 422 %y = load i32, ptr addrspace(1) %gep23 call void @foo(i32 %y) nounwind24 ret i32 %y25}26 27define i32 @store_as2(ptr addrspace(2) %x) {28; CHECK-LABEL: @store_as2(29; CHECK: call void @foo(30 %gep = getelementptr i32, ptr addrspace(2) %x, i32 431 %y = load i32, ptr addrspace(2) %gep32 call void @foo(i32 %y) nounwind33 ret i32 %y34}35 36