From 99d6e95c7408a4e74252aec80fd2dfd2443c1e86 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 7 Dec 2016 03:04:34 +0000 Subject: [PATCH] LowerTypeTests: Add a test that covers "unsatisfiable" type metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288881 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/LowerTypeTests/unsat.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/Transforms/LowerTypeTests/unsat.ll diff --git a/test/Transforms/LowerTypeTests/unsat.ll b/test/Transforms/LowerTypeTests/unsat.ll new file mode 100644 index 00000000000..5bafc9e8c40 --- /dev/null +++ b/test/Transforms/LowerTypeTests/unsat.ll @@ -0,0 +1,12 @@ +; FIXME: We should not require -O2 to simplify this to return false. +; RUN: opt -S -lowertypetests -O2 < %s | FileCheck %s + +target datalayout = "e-p:32:32" + +declare i1 @llvm.type.test(i8* %ptr, metadata %bitset) nounwind readnone + +define i1 @foo(i8* %p) { + %x = call i1 @llvm.type.test(i8* %p, metadata !"typeid1") + ; CHECK: ret i1 false + ret i1 %x +}