summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2017-01-31 17:53:49 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2017-01-31 17:53:49 +0000
commitc368563bd679fd74dd19723f78352b4f5b5c4164 (patch)
tree35358906ac462ba9fb269d789e270d616bd0501a /llvm/test/Transforms
parent274df5ea4135e4bab5ce1f59282ce21a4d255750 (diff)
downloadbcm5719-llvm-c368563bd679fd74dd19723f78352b4f5b5c4164.tar.gz
bcm5719-llvm-c368563bd679fd74dd19723f78352b4f5b5c4164.zip
Don't combine stores to a swifterror pointer operand to a different type
llvm-svn: 293658
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/load.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/load.ll b/llvm/test/Transforms/InstCombine/load.ll
index cad2899ea35..49ed897fd2e 100644
--- a/llvm/test/Transforms/InstCombine/load.ll
+++ b/llvm/test/Transforms/InstCombine/load.ll
@@ -219,3 +219,22 @@ entry:
store %swift.error* %err.res, %swift.error** %err, align 8
ret void
}
+
+; Make sure we preseve the type of the store to a swifterror pointer.
+; CHECK-LABEL: @test19(
+; CHECK: [[A:%.*]] = alloca
+; CHECK: call
+; CHECK: [[BC:%.*]] = bitcast i8** [[A]] to
+; CHECK: [[ERRVAL:%.*]] = load {{.*}}[[BC]]
+; CHECK: store {{.*}}[[ERRVAL]]
+; CHECK: ret
+declare void @initi8(i8**)
+define void @test19(%swift.error** swifterror %err) {
+entry:
+ %tmp = alloca i8*, align 8
+ call void @initi8(i8** %tmp)
+ %swifterror = bitcast i8** %tmp to %swift.error**
+ %err.res = load %swift.error*, %swift.error** %swifterror, align 8
+ store %swift.error* %err.res, %swift.error** %err, align 8
+ ret void
+}
OpenPOWER on IntegriCloud