1*2fc0d17eSVincent Lee; RUN: opt -passes="ipsccp<func-spec>" -force-specialization -S < %s
2*2fc0d17eSVincent Lee; Check that we don't crash when SwitchInst Constant is not ConstantInt.
3*2fc0d17eSVincent Lee
4*2fc0d17eSVincent Lee@S = external constant [1 x i8]
5*2fc0d17eSVincent Lee
6*2fc0d17eSVincent Leedefine i1 @foo() {
7*2fc0d17eSVincent Leeentry:
8*2fc0d17eSVincent Lee  %tmp = call i32 @bar(ptr @S)
9*2fc0d17eSVincent Lee  ret i1 0
10*2fc0d17eSVincent Lee}
11*2fc0d17eSVincent Lee
12*2fc0d17eSVincent Leedefine i32 @bar(ptr %arg) {
13*2fc0d17eSVincent Leeentry:
14*2fc0d17eSVincent Lee  %magicptr = ptrtoint ptr %arg to i64
15*2fc0d17eSVincent Lee  switch i64 %magicptr, label %bb2 [
16*2fc0d17eSVincent Lee    i64 0, label %bb1
17*2fc0d17eSVincent Lee  ]
18*2fc0d17eSVincent Leebb1:
19*2fc0d17eSVincent Lee  ret i32 0
20*2fc0d17eSVincent Leebb2:
21*2fc0d17eSVincent Lee  ret i32 1
22*2fc0d17eSVincent Lee}
23