1 // REQUIRES: x86-registered-target
2
3 // RUN: %clang_cc1 -triple x86_64-pc-linux -S -o - < %s | FileCheck %s
4 // RUN: %clang_cc1 -triple x86_64-pc-linux -S -fseparate-named-sections -o - < %s | FileCheck %s --check-prefix=SEPARATE
5
f(void)6 __attribute__((section("custom_text"))) void f(void) {}
g(void)7 __attribute__((section("custom_text"))) void g(void) {}
8
9 // CHECK: .section custom_text,"ax",@progbits{{$}}
10 // CHECK: f:
11 // CHECK: g:
12
13 // SEPARATE: .section custom_text,"ax",@progbits,unique,1{{$}}
14 // SEPARATE: f:
15 // SEPARATE: .section custom_text,"ax",@progbits,unique,2{{$}}
16 // SEPARATE: g:
17
18 __attribute__((section("custom_data"))) int i = 0;
19 __attribute__((section("custom_data"))) int j = 0;
20
21 // CHECK: .section custom_data,"aw",@progbits{{$}}
22 // CHECK: i:
23 // CHECK: j:
24
25 // SEPARATE: .section custom_data,"aw",@progbits,unique,3{{$}}
26 // SEPARATE: i:
27 // SEPARATE: .section custom_data,"aw",@progbits,unique,4{{$}}
28 // SEPARATE: j:
29