blob: f262657a56d0bcc0bf2f96085e1005a7aeff1e40 [file] [log] [blame]
Thomas Livelyf6f4f842019-03-20 20:26:45 +00001; RUN: llc < %s | FileCheck %s --check-prefixes CHECK,ATTRS
2; RUN: llc < %s -mattr=+simd128 | FileCheck %s --check-prefixes CHECK,SIMD128
3; RUN; llc < %s -mattr=+atomics | FileCheck %s --check-prefixes CHECK,ATOMICS
4; RUN: llc < %s -mcpu=bleeding-edge | FileCheck %s --check-prefixes CHECK,BLEEDING-EDGE
5
6; Test that codegen emits target features from the command line or
7; function attributes correctly.
8
9target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
10target triple = "wasm32-unknown-unknown"
11
12define void @foo() #0 {
13 ret void
14}
15
16define void @bar() #1 {
17 ret void
18}
19
20attributes #0 = { "target-features"="+sign-ext" }
21attributes #1 = { "target-features"="+nontrapping-fptoint" }
22
23; CHECK-LABEL: .custom_section.target_features,"",@
24
25; -atomics, +sign_ext
26; ATTRS-NEXT: .int8 3
27; ATTRS-NEXT: .int8 45
28; ATTRS-NEXT: .int8 7
29; ATTRS-NEXT: .ascii "atomics"
30; ATTRS-NEXT: .int8 43
31; ATTRS-NEXT: .int8 19
32; ATTRS-NEXT: .ascii "nontrapping-fptoint"
33; ATTRS-NEXT: .int8 43
34; ATTRS-NEXT: int8 8
35; ATTRS-NEXT: .ascii "sign-ext"
36
37; -atomics, +simd128
38; SIMD128-NEXT: .int8 2
39; SIMD128-NEXT: .int8 45
40; SIMD128-NEXT: .int8 7
41; SIMD128-NEXT: .ascii "atomics"
42; SIMD128-NEXT: .int8 43
43; SIMD128-NEXT: .int8 7
44; SIMD128-NEXT: .ascii "simd128"
45
46; =atomics
47; ATOMICS-NEXT: .int8 1
48; ATOMICS-NEXT: .int8 61
49; ATOMICS-NEXT: .int8 7
50; ATOMICS-NEXT: .ascii "atomics"
51
52; =atomics, +nontrapping-fptoint, +sign-ext, +simd128
53; BLEEDING-EDGE-NEXT: .int8 4
54; BLEEDING-EDGE-NEXT: .int8 61
55; BLEEDING-EDGE-NEXT: .int8 7
56; BLEEDING-EDGE-NEXT: .ascii "atomics"
57; BLEEDING-EDGE-NEXT: .int8 43
58; BLEEDING-EDGE-NEXT: .int8 19
59; BLEEDING-EDGE-NEXT: .ascii "nontrapping-fptoint"
60; BLEEDING-EDGE-NEXT: .int8 43
61; BLEEDING-EDGE-NEXT: .int8 8
62; BLEEDING-EDGE-NEXT: .ascii "sign-ext"
63; BLEEDING-EDGE-NEXT: .int8 43
64; BLEEDING-EDGE-NEXT: .int8 7
65; BLEEDING-EDGE-NEXT: .ascii "simd128"
66
67; CHECK-NEXT: .text