xref: /llvm-project/llvm/test/CodeGen/X86/code-model-elf-text-sections.ll (revision 281d71604f418eb952e967d9dc4b26241b7f96aa)
1; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -o %t
2; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
3; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -o %t
4; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
5; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -o %t
6; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE
7
8; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -function-sections -o %t
9; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL-DS
10; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -function-sections -o %t
11; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL-DS
12; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -function-sections -o %t
13; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE-DS
14
15; SMALL: .text {{.*}} AX {{.*}}
16; SMALL: .ltext {{.*}} AXl {{.*}}
17; SMALL: .ltext.2 {{.*}} AXl {{.*}}
18; SMALL: .foo {{.*}} AX {{.*}}
19; SMALL-DS: .text.func {{.*}} AX {{.*}}
20; SMALL-DS: .ltext {{.*}} AXl {{.*}}
21; SMALL-DS: .ltext.2 {{.*}} AXl {{.*}}
22; SMALL-DS: .foo {{.*}} AX {{.*}}
23; LARGE: .ltext {{.*}} AXl {{.*}}
24; LARGE: .ltext.2 {{.*}} AXl {{.*}}
25; LARGE: .foo {{.*}} AX {{.*}}
26; LARGE-DS: .ltext.func {{.*}} AXl {{.*}}
27; LARGE-DS: .ltext {{.*}} AXl {{.*}}
28; LARGE-DS: .ltext.2 {{.*}} AXl {{.*}}
29; LARGE-DS: .foo {{.*}} AX {{.*}}
30
31target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
32target triple = "x86_64--linux"
33
34define void @func() {
35  ret void
36}
37
38define void @ltext() section ".ltext" {
39  ret void
40}
41
42define void @ltext2() section ".ltext.2" {
43  ret void
44}
45
46define void @foo() section ".foo" {
47  ret void
48}
49