xref: /llvm-project/llvm/test/CodeGen/WebAssembly/custom-sections.ll (revision 122b0220fd45ee71acda912b0b712bb8edb6ba46)
1; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3; Test the mechanism for defining user custom sections.
4
5target triple = "wasm32-unknown-unknown"
6
7!0 = !{ !"red", !"foo" }
8!1 = !{ !"green", !"bar" }
9!2 = !{ !"green", !"qux" }
10!wasm.custom_sections = !{ !0, !1, !2 }
11
12!llvm.ident = !{!3}
13!3 = !{!"clang version 123"}
14
15!llvm.module.flags = !{!4}
16!4 = !{i32 2, !"Debug Info Version", i32 3}
17
18!llvm.dbg.cu = !{!5}
19!5 = distinct !DICompileUnit(language: DW_LANG_C99, file: !6)
20!6 = !DIFile(filename: "test", directory: "testdir")
21
22; CHECK:      .section	.custom_section.red,"",@
23; CHECK-NEXT: .ascii	"foo"
24
25; CHECK:      .section	.custom_section.green,"",@
26; CHECK-NEXT: .ascii	"bar"
27
28; CHECK:      .section	.custom_section.green,"",@
29; CHECK-NEXT: .ascii	"qux"
30
31; CHECK:      .section	.custom_section.producers,"",@
32; CHECK-NEXT: .int8	2
33; CHECK-NEXT: .int8	8
34; CHECK-NEXT: .ascii	"language"
35; CHECK-NEXT: .int8	1
36; CHECK-NEXT: .int8	3
37; CHECK-NEXT: .ascii	"C99"
38; CHECK-NEXT: .int8	0
39; CHECK-NEXT: .int8	12
40; CHECK-NEXT: .ascii	"processed-by"
41; CHECK-NEXT: .int8	1
42; CHECK-NEXT: .int8	5
43; CHECK-NEXT: .ascii	"clang"
44; CHECK-NEXT: .int8	3
45; CHECK-NEXT: .ascii	"123"
46