1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s -passes=jump-table-to-switch -jump-table-to-switch-function-size-threshold=1 -verify-dom-info -S | FileCheck %s
4 @func_array0 = constant [2 x ptr] [ptr @func0, ptr @large_func]
10 define i32 @large_func() {
15 define 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 8
20 ; CHECK-NEXT: [[RESULT:%.*]] = call i32 [[FUNC_PTR]]()
21 ; CHECK-NEXT: ret i32 [[RESULT]]
23 %gep = getelementptr inbounds [2 x ptr], ptr @func_array0, i32 0, i32 %index
24 %func_ptr = load ptr, ptr %gep, align 8
25 %result = call i32 %func_ptr()