[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ARM / thumb-function-address.s
blob9200b54a80e986da26a70a8fcc3ce921df443299
1 @ RUN: llvm-mc -filetype=obj -triple=armv7-linux-gnueabi %s -o %t
2 @ RUN: llvm-readelf -s %t | FileCheck %s
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.
9 .syntax unified
10 .text
11 .thumb
12 func_label:
13 .type func_label, %function
15 .type foo_impl, %function
16 foo_impl:
17 bx lr
18 .type foo_resolver, %function
19 foo_resolver:
20 b foo_impl
21 .type foo, %gnu_indirect_function
22 .set foo, foo_resolver
24 @@ Note: GNU as sets the value to 1.
25 .thumb
26 label:
27 bx lr
28 .arm
29 bx lr
30 .type label, %function
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