Florian Hahn | cc524bf | 2017-06-07 11:50:45 +0000 | [diff] [blame] | 1 | // 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 | |
| 9 | void t1() {} |
| 10 | |
| 11 | __attribute__((target("no-thumb-mode"))) |
| 12 | void t2() {} |
| 13 | |
| 14 | __attribute__((target("thumb-mode"))) |
| 15 | void t3() {} |
| 16 | |
| 17 | // THUMB: void @t1() [[ThumbAttr:#[0-7]]] |
| 18 | // THUMB: void @t2() [[NoThumbAttr:#[0-7]]] |
| 19 | // THUMB: void @t3() [[ThumbAttr:#[0-7]]] |
Eli Friedman | 642a5ee | 2018-04-16 23:52:58 +0000 | [diff] [blame] | 20 | // THUMB: attributes [[ThumbAttr]] = { {{.*}} "target-features"="+armv7-a,+thumb-mode" |
| 21 | // THUMB: attributes [[NoThumbAttr]] = { {{.*}} "target-features"="+armv7-a,-thumb-mode" |
Florian Hahn | cc524bf | 2017-06-07 11:50:45 +0000 | [diff] [blame] | 22 | // |
| 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 Friedman | 642a5ee | 2018-04-16 23:52:58 +0000 | [diff] [blame] | 32 | // ARM: attributes [[NoThumbAttr]] = { {{.*}} "target-features"="+armv7-a,-thumb-mode" |
| 33 | // ARM: attributes [[ThumbAttr]] = { {{.*}} "target-features"="+armv7-a,+thumb-mode" |