1bf215546Sopenharmony_ci; RUN: ./amdgcn_glslc -mcpu=tahiti %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=SI %s
2bf215546Sopenharmony_ci; RUN: ./amdgcn_glslc -mcpu=bonaire %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=CI %s
3bf215546Sopenharmony_ci; RUN: ./amdgcn_glslc -mcpu=tonga %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=CI %s
4bf215546Sopenharmony_ci
5bf215546Sopenharmony_ci; Only SI has buggy v_fract and must use v_floor.
6bf215546Sopenharmony_ci; The amdgcn.fract intrinsic can be used only if LLVM passes are able to move it.
7bf215546Sopenharmony_ci
8bf215546Sopenharmony_ci; FUNC-LABEL: {{^}}@fract:
9bf215546Sopenharmony_ci; GCN: main
10bf215546Sopenharmony_ci; GCN: v_interp_mov
11bf215546Sopenharmony_ci; SI-NEXT: v_floor_f32
12bf215546Sopenharmony_ci; SI-NEXT: v_subrev_f32
13bf215546Sopenharmony_ci; CI-NEXT: v_fract_f32
14bf215546Sopenharmony_ci; GCN-NEXT: epilog
15bf215546Sopenharmony_ci
16bf215546Sopenharmony_ci#shader fs fract
17bf215546Sopenharmony_ci#version 400
18bf215546Sopenharmony_ciflat in float f;
19bf215546Sopenharmony_civoid main() {
20bf215546Sopenharmony_ci    gl_FragColor.x = fract(f);
21bf215546Sopenharmony_ci}
22