blob: 2b86529dc634d4e587504c8b54d73aab8882ecab [file] [log] [blame]
Florian Hahncc524bf2017-06-07 11:50:45 +00001// REQUIRES: arm-registered-target
2
3// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -emit-llvm -o - %s | FileCheck --check-prefix THUMB %s
4// RUN: %clang_cc1 -triple thumbv7eb-linux-gnueabihf -emit-llvm -o - %s | FileCheck --check-prefix THUMB %s
5// RUN: %clang -target armv7-linux-gnueabihf -mthumb -S -emit-llvm -o - %s | FileCheck --check-prefix THUMB-CLANG %s
6// RUN: %clang_cc1 -triple armv7-linux-gnueabihf -emit-llvm -o - %s | FileCheck --check-prefix ARM %s
7// RUN: %clang_cc1 -triple armv7eb-linux-gnueabihf -emit-llvm -o - %s | FileCheck --check-prefix ARM %s
8
9void t1() {}
10
11 __attribute__((target("no-thumb-mode")))
12void t2() {}
13
14 __attribute__((target("thumb-mode")))
15void t3() {}
16
17// THUMB: void @t1() [[ThumbAttr:#[0-7]]]
18// THUMB: void @t2() [[NoThumbAttr:#[0-7]]]
19// THUMB: void @t3() [[ThumbAttr:#[0-7]]]
Eli Friedman642a5ee2018-04-16 23:52:58 +000020// THUMB: attributes [[ThumbAttr]] = { {{.*}} "target-features"="+armv7-a,+thumb-mode"
21// THUMB: attributes [[NoThumbAttr]] = { {{.*}} "target-features"="+armv7-a,-thumb-mode"
Florian Hahncc524bf2017-06-07 11:50:45 +000022//
23// THUMB-CLANG: void @t1() [[ThumbAttr:#[0-7]]]
24// THUMB-CLANG: void @t2() [[NoThumbAttr:#[0-7]]]
25// THUMB-CLANG: void @t3() [[ThumbAttr:#[0-7]]]
26// THUMB-CLANG: attributes [[ThumbAttr]] = { {{.*}} "target-features"="{{.*}}+thumb-mode
27// THUMB-CLANG: attributes [[NoThumbAttr]] = { {{.*}} "target-features"="{{.*}}-thumb-mode
28
29// ARM: void @t1() [[NoThumbAtr:#[0-7]]]
30// ARM: void @t2() [[NoThumbAttr:#[0-7]]]
31// ARM: void @t3() [[ThumbAttr:#[0-7]]]
Eli Friedman642a5ee2018-04-16 23:52:58 +000032// ARM: attributes [[NoThumbAttr]] = { {{.*}} "target-features"="+armv7-a,-thumb-mode"
33// ARM: attributes [[ThumbAttr]] = { {{.*}} "target-features"="+armv7-a,+thumb-mode"