1 ; RUN: llc < %s -verify-machineinstrs | FileCheck %s
3 ; Wasm does not currently support function addresses with offsets, so we
4 ; shouldn't try to create a folded SDNode like (function + offset). This is a
5 ; regression test for the folding bug and this should not crash in MCInstLower.
7 target triple = "wasm32-unknown-unknown"
9 ; 'hidden' here should be present to reproduce the bug
10 declare hidden void @ham(ptr)
12 define void @bar(ptr %ptr) {
14 br i1 undef, label %bb3, label %bb2
17 ; While lowering this switch, isel creates (@ham + 1) expression as a course
18 ; of range optimization for switch, and tries to fold the expression, but
19 ; wasm does not support with function addresses with offsets. This folding
21 ; CHECK: i32.const ham
22 ; CHECK-NEXT: i32.const 1
24 switch i32 ptrtoint (ptr @ham to i32), label %bb4 [
33 %tmp = load i8, ptr %ptr