1; RUN: llc < %s -mattr=-bulk-memory,atomics | FileCheck %s --check-prefixes NO-BULK-MEM
2; RUN: llc < %s -mattr=+bulk-memory,atomics | FileCheck %s --check-prefixes BULK-MEM
3
4; Test that the target features section contains -atomics or +atomics
5; for modules that have thread local storage in their source.
6
7target triple = "wasm32-unknown-unknown"
8
9@foo = internal thread_local global i32 0
10
11; -bulk-memory
12; NO-BULK-MEM-LABEL: .custom_section.target_features,"",@
13; NO-BULK-MEM-NEXT: .int8 2
14; NO-BULK-MEM-NEXT: .int8 43
15; NO-BULK-MEM-NEXT: .int8 7
16; NO-BULK-MEM-NEXT: .ascii "atomics"
17; NO-BULK-MEM-NEXT: .int8 45
18; NO-BULK-MEM-NEXT: .int8 10
19; NO-BULK-MEM-NEXT: .ascii "shared-mem"
20; NO-BULK-MEM-NEXT: .bss.foo,"",@
21
22; +bulk-memory
23; BULK-MEM-LABEL: .custom_section.target_features,"",@
24; BULK-MEM-NEXT: .int8 2
25; BULK-MEM-NEXT: .int8 43
26; BULK-MEM-NEXT: .int8 7
27; BULK-MEM-NEXT: .ascii "atomics"
28; BULK-MEM-NEXT: .int8 43
29; BULK-MEM-NEXT: .int8 11
30; BULK-MEM-NEXT: .ascii "bulk-memory"
31; BULK-MEM-NEXT: .tbss.foo,"T",@
32