summaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX/nvvm-reflect.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/NVPTX/nvvm-reflect.ll')
-rw-r--r--test/CodeGen/NVPTX/nvvm-reflect.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/nvvm-reflect.ll b/test/CodeGen/NVPTX/nvvm-reflect.ll
index 45438847b8..21e9c69e65 100644
--- a/test/CodeGen/NVPTX/nvvm-reflect.ll
+++ b/test/CodeGen/NVPTX/nvvm-reflect.ll
@@ -32,3 +32,17 @@ exit:
%ret = phi float [%ret1, %use_mul], [%ret2, %use_add]
ret float %ret
}
+
+declare i32 @llvm.nvvm.reflect.p0i8(i8*)
+
+; USE_MUL_0: define i32 @intrinsic
+; USE_MUL_1: define i32 @intrinsic
+define i32 @intrinsic() {
+; USE_MUL_0-NOT: call i32 @llvm.nvvm.reflect
+; USE_MUL_0: ret i32 0
+; USE_MUL_1-NOT: call i32 @llvm.nvvm.reflect
+; USE_MUL_1: ret i32 1
+ %ptr = tail call i8* @llvm.nvvm.ptr.constant.to.gen.p0i8.p4i8(i8 addrspace(4)* getelementptr inbounds ([8 x i8] addrspace(4)* @str, i32 0, i32 0))
+ %reflect = tail call i32 @llvm.nvvm.reflect.p0i8(i8* %ptr)
+ ret i32 %reflect
+}