1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s --check-prefix=ASSEM-DISASS
2 ; RUN: opt < %s -O3 -S | FileCheck %s --check-prefix=OPT
3 ; RUN: verify-uselistorder %s
4 ; Basic smoke tests for bfloat type.
6 define bfloat @check_bfloat(bfloat %A) {
7 ; ASSEM-DISASS: ret bfloat %A
11 define bfloat @check_bfloat_literal() {
12 ; ASSEM-DISASS: ret bfloat 0xR3149
16 define <4 x bfloat> @check_fixed_vector() {
17 ; ASSEM-DISASS: ret <4 x bfloat> %tmp
18 %tmp = fadd <4 x bfloat> undef, undef
22 define <vscale x 4 x bfloat> @check_vector() {
23 ; ASSEM-DISASS: ret <vscale x 4 x bfloat> %tmp
24 %tmp = fadd <vscale x 4 x bfloat> undef, undef
25 ret <vscale x 4 x bfloat> %tmp
28 define bfloat @check_bfloat_constprop() {
29 %tmp = fadd bfloat 0xR40C0, 0xR40C0
34 define float @check_bfloat_convert() {
35 %tmp = fpext bfloat 0xR4C8D to float
36 ; OPT: 0x4191A00000000000
40 ; ASSEM-DISASS-LABEL @snan_bfloat
41 define bfloat @snan_bfloat() {
42 ; ASSEM-DISASS: ret bfloat 0xR7F81
46 ; ASSEM-DISASS-LABEL @qnan_bfloat
47 define bfloat @qnan_bfloat() {
48 ; ASSEM-DISASS: ret bfloat 0xR7FC0
52 ; ASSEM-DISASS-LABEL @pos_inf_bfloat
53 define bfloat @pos_inf_bfloat() {
54 ; ASSEM-DISASS: ret bfloat 0xR7F80
58 ; ASSEM-DISASS-LABEL @neg_inf_bfloat
59 define bfloat @neg_inf_bfloat() {
60 ; ASSEM-DISASS: ret bfloat 0xRFF80