1; RUN: llvm-as -o %t %s
2; RUN: llvm-lto2 run %t -O0 -r %t,foo,px -o %t2
3
4; This just tests that we don't crash when compiling this test case.
5; It means that the wholeprogramdevirt pass must have run and lowered
6; the llvm.type.checked.load call.
7
8target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9target triple = "x86_64-unknown-linux-gnu"
10
11define {i8*, i1} @foo(i8* %ptr) {
12  %pair = call {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 16, metadata !"foo")
13  ret {i8*, i1} %pair
14}
15
16declare {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 %offset, metadata %type)
17