29 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt < %s -passes=jump-table-to-switch -jump-table-to-switch-function-size-threshold=1 -verify-dom-info -S | FileCheck %s3 4@func_array0 = constant [2 x ptr] [ptr @func0, ptr @large_func]5 6define i32 @func0() {7 ret i32 18}9 10define i32 @large_func() {11 %x = add i32 1, 212 ret i32 %x13}14 15define i32 @function_with_jump_table_with_large_func(i32 %index) {16; CHECK-LABEL: define i32 @function_with_jump_table_with_large_func(17; CHECK-SAME: i32 [[INDEX:%.*]]) {18; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds [2 x ptr], ptr @func_array0, i32 0, i32 [[INDEX]]19; CHECK-NEXT: [[FUNC_PTR:%.*]] = load ptr, ptr [[GEP]], align 820; CHECK-NEXT: [[RESULT:%.*]] = call i32 [[FUNC_PTR]]()21; CHECK-NEXT: ret i32 [[RESULT]]22;23 %gep = getelementptr inbounds [2 x ptr], ptr @func_array0, i32 0, i32 %index24 %func_ptr = load ptr, ptr %gep, align 825 %result = call i32 %func_ptr()26 ret i32 %result27}28 29