1 // RUN: tco %s | FileCheck %s
3 func.func @test_box_typecode(%a: !fir.class<none>) -> i32 {
4 %0 = fir.box_typecode %a : (!fir.class<none>) -> i32
8 // CHECK-LABEL: @test_box_typecode(
9 // CHECK-SAME: ptr %[[BOX:.*]])
10 // CHECK: %[[GEP:.*]] = getelementptr { ptr, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}} }, ptr %[[BOX]], i32 0, i32 4
11 // CHECK: %[[TYPE_CODE:.*]] = load i8, ptr %[[GEP]]
12 // CHECK: %[[TYPE_CODE_CONV:.*]] = sext i8 %[[TYPE_CODE]] to i32
13 // CHECK: ret i32 %[[TYPE_CODE_CONV]]