xref: /llvm-project/polly/test/CodeGen/select-base-pointer.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly -aa-pipeline=tbaa -passes=polly-codegen -disable-output %s
2;
3; Check that we do not crash here.
4;
5; ModuleID = 'bugpoint-reduced-simplified.bc'
6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7
8%"DOMParentNode" = type { ptr, ptr, %"DOMNodeListImpl" }
9%"DOMDocumentRange" = type { ptr }
10%"DOMXPathEvaluator" = type { ptr }
11%"DOMDocumentTraversal" = type { ptr }
12%"DOMNode" = type { ptr }
13%"DOMNodeListImpl" = type { %"DOMNodeList", ptr }
14%"DOMNodeList" = type { ptr }
15%"DOMElementImpl" = type { %"DOMElement", %"DOMNodeImpl", %"DOMParentNode", %"DOMChildNode", ptr, ptr, ptr }
16%"DOMElement" = type { %"DOMNode" }
17%"DOMNodeImpl" = type <{ ptr, i16, [6 x i8] }>
18%"DOMChildNode" = type { ptr, ptr }
19%"DOMAttrMapImpl" = type <{ %"DOMNamedNodeMapImpl", i8, [7 x i8] }>
20%"DOMNamedNodeMapImpl" = type { %"DOMNamedNodeMap", ptr }
21%"DOMNamedNodeMap" = type { ptr }
22%"DOMTextImpl" = type { %"DOMText", %"DOMNodeImpl", %"DOMChildNode" }
23%"DOMText" = type { %"DOMCharacterData" }
24%"DOMCharacterData" = type { %"DOMNode" }
25
26; Function Attrs: uwtable
27define void @_ZN11xercesc_2_513DOMParentNode9lastChildEPNS_7DOMNodeE(ptr %this, ptr %node) #0 align 2 {
28entry:
29  br label %entry.split
30
31entry.split:                                      ; preds = %entry
32  %fFirstChild = getelementptr inbounds %"DOMParentNode", ptr %this, i32 0, i32 1
33  %0 = load ptr, ptr %fFirstChild, align 8, !tbaa !1
34  %cmp = icmp ne ptr %0, null
35  br i1 %cmp, label %if.then, label %if.end
36
37if.then:                                          ; preds = %entry.split
38  %fNode.i = getelementptr inbounds %"DOMElementImpl", ptr %0, i32 0, i32 1
39  %flags.i.i = getelementptr inbounds %"DOMNodeImpl", ptr %fNode.i, i32 0, i32 1
40  %1 = load i16, ptr %flags.i.i, align 8, !tbaa !7
41  %fChild.i = getelementptr inbounds %"DOMTextImpl", ptr %0, i32 0, i32 2
42  %fChild1.i = getelementptr inbounds %"DOMElementImpl", ptr %0, i32 0, i32 3
43  %retval.0.i = select i1 undef, ptr %fChild.i, ptr %fChild1.i
44  store ptr %node, ptr %retval.0.i, align 8, !tbaa !10
45  br label %if.end
46
47if.end:                                           ; preds = %if.then, %entry.split
48  ret void
49}
50
51!0 = !{!"clang version 3.9.0"}
52!1 = !{!2, !3, i64 8}
53!2 = !{!"_ZTSN11xercesc_2_513DOMParentNodeE", !3, i64 0, !3, i64 8, !6, i64 16}
54!3 = !{!"any pointer", !4, i64 0}
55!4 = !{!"omnipotent char", !5, i64 0}
56!5 = !{!"Simple C++ TBAA"}
57!6 = !{!"_ZTSN11xercesc_2_515DOMNodeListImplE", !3, i64 8}
58!7 = !{!8, !9, i64 8}
59!8 = !{!"_ZTSN11xercesc_2_511DOMNodeImplE", !3, i64 0, !9, i64 8}
60!9 = !{!"short", !4, i64 0}
61!10 = !{!11, !3, i64 0}
62!11 = !{!"_ZTSN11xercesc_2_512DOMChildNodeE", !3, i64 0, !3, i64 8}
63