1@ RUN: llvm-mc -filetype=obj -triple=armv7-linux-gnueabi %s -o %t
2@ RUN: llvm-readelf -s %t | FileCheck %s
3
4@@ GNU as sets the thumb state according to the thumb state of the label. If a
5@@ .type directive is placed after the label, set the symbol's thumb state
6@@ according to the thumb state of the .type directive. This matches GNU as in
7@@ most cases.
8
9.syntax unified
10.text
11.thumb
12func_label:
13.type func_label, %function
14
15.type foo_impl, %function
16foo_impl:
17  bx lr
18.type foo_resolver, %function
19foo_resolver:
20  b foo_impl
21.type foo, %gnu_indirect_function
22.set foo, foo_resolver
23
24@@ Note: GNU as sets the value to 1.
25.thumb
26label:
27  bx lr
28.arm
29  bx lr
30.type label, %function
31
32@@ Check func_label, foo_impl, foo_resolver, and foo addresses have bit 0 set.
33@@ Check label has bit 0 unset.
34@ CHECK:      Value Size Type   Bind  Vis     Ndx Name
35@ CHECK-NEXT: 00000000 0 NOTYPE LOCAL DEFAULT     UND
36@ CHECK-NEXT: 00000001 0 FUNC   LOCAL DEFAULT 2   func_label
37@ CHECK-NEXT: 00000001 0 FUNC   LOCAL DEFAULT 2   foo_impl
38@ CHECK-NEXT: 00000000 0 NOTYPE LOCAL DEFAULT 2   $t.0
39@ CHECK-NEXT: 00000003 0 FUNC   LOCAL DEFAULT 2   foo_resolver
40@ CHECK-NEXT: 00000003 0 IFUNC  LOCAL DEFAULT 2   foo
41@ CHECK-NEXT: 00000004 0 FUNC   LOCAL DEFAULT 2   label
42@ CHECK-NEXT: 00000006 0 NOTYPE LOCAL DEFAULT 2   $a.1
43