| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 |
| ; RUN: opt -S -passes=lowertypetests -lowertypetests-summary-action=import -lowertypetests-read-summary=%S/Inputs/import.yaml %s | FileCheck %s |
| |
| target datalayout = "e-p:64:64" |
| target triple = "x86_64-unknown-linux" |
| |
| declare i1 @llvm.type.test(ptr %ptr, metadata %bitset) nounwind readnone |
| |
| define i1 @bytearray7(ptr %p) { |
| ; CHECK-LABEL: define i1 @bytearray7( |
| ; CHECK-SAME: ptr [[P:%.*]]) { |
| ; CHECK-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[P]] to i64 |
| ; CHECK-NEXT: [[TMP2:%.*]] = sub i64 [[TMP1]], ptrtoint (ptr @__typeid_bytearray7_global_addr to i64) |
| ; CHECK-NEXT: [[TMP3:%.*]] = lshr i64 [[TMP2]], zext (i8 ptrtoint (ptr @__typeid_bytearray7_align to i8) to i64) |
| ; CHECK-NEXT: [[TMP4:%.*]] = shl i64 [[TMP2]], zext (i8 sub (i8 64, i8 ptrtoint (ptr @__typeid_bytearray7_align to i8)) to i64) |
| ; CHECK-NEXT: [[TMP5:%.*]] = or i64 [[TMP3]], [[TMP4]] |
| ; CHECK-NEXT: [[TMP6:%.*]] = icmp ule i64 [[TMP5]], ptrtoint (ptr @__typeid_bytearray7_size_m1 to i64) |
| ; CHECK-NEXT: br i1 [[TMP6]], label [[TMP7:%.*]], label [[F:%.*]] |
| ; CHECK: 7: |
| ; CHECK-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr @__typeid_bytearray7_byte_array, i64 [[TMP5]] |
| ; CHECK-NEXT: [[TMP9:%.*]] = load i8, ptr [[TMP8]], align 1 |
| ; CHECK-NEXT: [[TMP10:%.*]] = and i8 [[TMP9]], ptrtoint (ptr @__typeid_bytearray7_bit_mask to i8) |
| ; CHECK-NEXT: [[TMP11:%.*]] = icmp ne i8 [[TMP10]], 0 |
| ; CHECK-NEXT: br i1 [[TMP11]], label [[T:%.*]], label [[F]] |
| ; CHECK: t: |
| ; CHECK-NEXT: ret i1 true |
| ; CHECK: f: |
| ; CHECK-NEXT: ret i1 false |
| ; |
| %x = call i1 @llvm.type.test(ptr %p, metadata !"bytearray7") |
| br i1 %x, label %t, label %f |
| |
| t: |
| ret i1 true |
| |
| f: |
| ret i1 false |
| } |