summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-06 00:50:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-06 00:50:21 +0000
commita5b9e1cf39f76de64b0a28e177006c93c961583d (patch)
treed3bd63679756be5728db10ff5f67f30c2ab3a0da /llvm/test/Linker
parent07e51cc72d867e18e752dc2e9d0278c103cdd58d (diff)
downloadbcm5719-llvm-a5b9e1cf39f76de64b0a28e177006c93c961583d.tar.gz
bcm5719-llvm-a5b9e1cf39f76de64b0a28e177006c93c961583d.zip
Remember to move a type to the correct set when setting the body.
We would set the body of a struct type (therefore making it non-opaque) but were forgetting to move it to the non-opaque set. Fixes pr22807. llvm-svn: 231442
Diffstat (limited to 'llvm/test/Linker')
-rw-r--r--llvm/test/Linker/Inputs/pr22807-1.ll6
-rw-r--r--llvm/test/Linker/Inputs/pr22807-2.ll6
-rw-r--r--llvm/test/Linker/pr22807.ll13
3 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/Linker/Inputs/pr22807-1.ll b/llvm/test/Linker/Inputs/pr22807-1.ll
new file mode 100644
index 00000000000..4081a9b00e4
--- /dev/null
+++ b/llvm/test/Linker/Inputs/pr22807-1.ll
@@ -0,0 +1,6 @@
+%struct.A = type { %struct.B* }
+%struct.B = type opaque
+
+define i32 @foo(%struct.A** %A) {
+ ret i32 0
+}
diff --git a/llvm/test/Linker/Inputs/pr22807-2.ll b/llvm/test/Linker/Inputs/pr22807-2.ll
new file mode 100644
index 00000000000..7739b77df25
--- /dev/null
+++ b/llvm/test/Linker/Inputs/pr22807-2.ll
@@ -0,0 +1,6 @@
+%struct.A = type { %struct.B* }
+%struct.B = type opaque
+
+define i32 @bar(%struct.A* %A) {
+ ret i32 0
+}
diff --git a/llvm/test/Linker/pr22807.ll b/llvm/test/Linker/pr22807.ll
new file mode 100644
index 00000000000..bb4ca2b4ccf
--- /dev/null
+++ b/llvm/test/Linker/pr22807.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-link -S -o - %p/pr22807.ll %p/Inputs/pr22807-1.ll %p/Inputs/pr22807-2.ll | FileCheck %s
+
+; CHECK-NOT: type
+; CHECK: %struct.B = type { %struct.A* }
+; CHECK-NEXT: %struct.A = type { %struct.B* }
+; CHECK-NOT: type
+
+%struct.B = type { %struct.A* }
+%struct.A = type opaque
+
+define i32 @baz(%struct.B* %BB) {
+ ret i32 0
+}
OpenPOWER on IntegriCloud