d0fd06a3437985ecd8036adf91936db61549b5e9
[oota-llvm.git] / test / CodeGen / AMDGPU / elf.ll
1 ; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
2 ; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs -o - | FileCheck --check-prefix=CONFIG --check-prefix=TYPICAL %s
3 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
4 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs -o - | FileCheck --check-prefix=CONFIG --check-prefix=TONGA %s
5 ; RUN: llc < %s -march=amdgcn -mcpu=carrizo -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
6 ; RUN: llc < %s -march=amdgcn -mcpu=carrizo -verify-machineinstrs -o - | FileCheck --check-prefix=CONFIG --check-prefix=TYPICAL %s
7
8 ; Test that we don't try to produce a COFF file on windows
9 ; RUN: llc < %s -mtriple=amdgcn-pc-mingw -mcpu=SI -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
10
11 ; ELF: Format: ELF32
12 ; ELF: Name: .AMDGPU.config
13 ; ELF: Type: SHT_PROGBITS
14
15 ; ELF: Symbol {
16 ; ELF: Name: test
17 ; ELF: Binding: Global
18
19 ; CONFIG: .section .AMDGPU.config
20 ; CONFIG-NEXT: .long   45096
21 ; TYPICAL-NEXT: .long   0
22 ; TONGA-NEXT: .long   576
23 ; CONFIG: .align 256
24 ; CONFIG: test:
25 define void @test(i32 %p) #0 {
26    %i = add i32 %p, 2
27    %r = bitcast i32 %i to float
28    call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %r, float %r, float %r, float %r)
29    ret void
30 }
31
32 declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
33
34 attributes #0 = { "ShaderType"="0" } ; Pixel Shader