summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>2017-10-14 16:15:28 +0000
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>2017-10-14 16:15:28 +0000
commite7b2dc3c3a89320b9a792806643b9731efa7d29f (patch)
tree455ef375035dbbe5b34642c0ddd5a3fd76877734 /test
parent473d951406163926637ec621337201bf470d5c77 (diff)
AMDGPU: Improve note directive verification in assembler
- Do not allow amd_amdgpu_isa directives on non-amdgcn architectures - Do not allow amd_amdgpu_hsa_metadata on non-amdhsa OSes - Do not allow amd_amdgpu_pal_metadata on non-amdpal OSes Differential Revision: https://reviews.llvm.org/D38750 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/AMDGPU/elf-notes-verify-amdgcn.s7
-rw-r--r--test/MC/AMDGPU/elf-notes-verify-r600.s10
2 files changed, 17 insertions, 0 deletions
diff --git a/test/MC/AMDGPU/elf-notes-verify-amdgcn.s b/test/MC/AMDGPU/elf-notes-verify-amdgcn.s
new file mode 100644
index 00000000000..73157ef953d
--- /dev/null
+++ b/test/MC/AMDGPU/elf-notes-verify-amdgcn.s
@@ -0,0 +1,7 @@
+// RUN: not llvm-mc -arch amdgcn %s 2>&1 | FileCheck --check-prefix=GCN %s
+
+// GCN: error: .amd_amdgpu_hsa_metadata directive is not available on non-amdhsa OSes
+.amd_amdgpu_hsa_metadata
+
+// GCN: error: .amd_amdgpu_pal_metadata directive is not available on non-amdpal OSes
+.amd_amdgpu_pal_metadata
diff --git a/test/MC/AMDGPU/elf-notes-verify-r600.s b/test/MC/AMDGPU/elf-notes-verify-r600.s
new file mode 100644
index 00000000000..d6144096bb9
--- /dev/null
+++ b/test/MC/AMDGPU/elf-notes-verify-r600.s
@@ -0,0 +1,10 @@
+// RUN: not llvm-mc -arch r600 %s 2>&1 | FileCheck --check-prefix=R600 %s
+
+// R600: error: .amd_amdgpu_isa directive is not available on non-amdgcn architectures
+.amd_amdgpu_isa "r600"
+
+// R600: error: .amd_amdgpu_hsa_metadata directive is not available on non-amdhsa OSes
+.amd_amdgpu_hsa_metadata
+
+// R600: error: .amd_amdgpu_pal_metadata directive is not available on non-amdpal OSes
+.amd_amdgpu_pal_metadata