1 ; RUN: opt -S -O2 < %s | FileCheck %s -check-prefix=ENABLE
2 ; RUN: opt -S -hexagon-emit-lookup-tables=true -O2 < %s | FileCheck %s -check-prefix=ENABLE
3 ; RUN: opt -S -hexagon-emit-lookup-tables=false -O2 < %s | FileCheck %s -check-prefix=DISABLE
6 ; ENABLE: @{{.*}} = private unnamed_addr constant [6 x i32] [i32 9, i32 20, i32 14, i32 22, i32 12, i32 5]
7 ; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [6 x i32] [i32 9, i32 20, i32 14, i32 22, i32 12, i32 5]
8 ; DISABLE : = phi i32 [ 19, %{{.*}} ], [ 5, %{{.*}} ], [ 12, %{{.*}} ], [ 22, %{{.*}} ], [ 14, %{{.*}} ], [ 20, %{{.*}} ], [ 9, %{{.*}} ]
10 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
11 target triple = "hexagon-unknown--elf"
13 ; Function Attrs: noinline nounwind
14 define i32 @foo(i32 %x) #0 section ".tcm_text" {
16 %retval = alloca i32, align 4
17 %x.addr = alloca i32, align 4
18 store i32 %x, i32* %x.addr, align 4
19 %0 = load i32, i32* %x.addr, align 4
20 switch i32 %0, label %sw.default [
29 sw.bb: ; preds = %entry
30 store i32 9, i32* %retval, align 4
33 sw.bb1: ; preds = %entry
34 store i32 20, i32* %retval, align 4
37 sw.bb2: ; preds = %entry
38 store i32 14, i32* %retval, align 4
41 sw.bb3: ; preds = %entry
42 store i32 22, i32* %retval, align 4
45 sw.bb4: ; preds = %entry
46 store i32 12, i32* %retval, align 4
49 sw.bb5: ; preds = %entry
50 store i32 5, i32* %retval, align 4
53 sw.default: ; preds = %entry
54 store i32 19, i32* %retval, align 4
57 return: ; preds = %sw.default, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb
58 %1 = load i32, i32* %retval, align 4
62 attributes #0 = { noinline nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv60" "target-features"="-hvx,-long-calls" "unsafe-fp-math"="false" "use-soft-float"="false" }