summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Assembler/invalid-mdlocation-field-bad.ll4
-rw-r--r--llvm/test/Assembler/invalid-mdlocation-field-twice.ll6
-rw-r--r--llvm/test/Assembler/invalid-mdlocation-overflow-column.ll9
-rw-r--r--llvm/test/Assembler/invalid-mdlocation-overflow-line.ll9
-rw-r--r--llvm/test/Assembler/invalid-specialized-mdnode.ll4
-rw-r--r--llvm/test/Assembler/mdlocation.ll20
6 files changed, 52 insertions, 0 deletions
diff --git a/llvm/test/Assembler/invalid-mdlocation-field-bad.ll b/llvm/test/Assembler/invalid-mdlocation-field-bad.ll
new file mode 100644
index 00000000000..6ec7c64bb4d
--- /dev/null
+++ b/llvm/test/Assembler/invalid-mdlocation-field-bad.ll
@@ -0,0 +1,4 @@
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:18: error: invalid field 'bad'
+!0 = !MDLocation(bad: 0)
diff --git a/llvm/test/Assembler/invalid-mdlocation-field-twice.ll b/llvm/test/Assembler/invalid-mdlocation-field-twice.ll
new file mode 100644
index 00000000000..2335c935a5f
--- /dev/null
+++ b/llvm/test/Assembler/invalid-mdlocation-field-twice.ll
@@ -0,0 +1,6 @@
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK: <stdin>:[[@LINE+1]]:38: error: field 'line' cannot be specified more than once
+!1 = !MDLocation(line: 3, scope: !0, line: 3)
diff --git a/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll b/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll
new file mode 100644
index 00000000000..d1dbb27173d
--- /dev/null
+++ b/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll
@@ -0,0 +1,9 @@
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK-NOT: error
+!1 = !MDLocation(column: 255, scope: !0)
+
+; CHECK: <stdin>:[[@LINE+1]]:26: error: value for 'column' too large, limit is 255
+!2 = !MDLocation(column: 256, scope: !0)
diff --git a/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll b/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll
new file mode 100644
index 00000000000..8e19f6919bf
--- /dev/null
+++ b/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll
@@ -0,0 +1,9 @@
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+!0 = !{}
+
+; CHECK-NOT: error
+!1 = !MDLocation(line: 16777215, scope: !0)
+
+; CHECK: <stdin>:[[@LINE+1]]:24: error: value for 'line' too large, limit is 16777215
+!2 = !MDLocation(line: 16777216, scope: !0)
diff --git a/llvm/test/Assembler/invalid-specialized-mdnode.ll b/llvm/test/Assembler/invalid-specialized-mdnode.ll
new file mode 100644
index 00000000000..9a84abbb314
--- /dev/null
+++ b/llvm/test/Assembler/invalid-specialized-mdnode.ll
@@ -0,0 +1,4 @@
+; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
+
+; CHECK: <stdin>:[[@LINE+1]]:6: error: expected metadata type
+!0 = !Invalid(field: 0)
diff --git a/llvm/test/Assembler/mdlocation.ll b/llvm/test/Assembler/mdlocation.ll
new file mode 100644
index 00000000000..e1216fa2750
--- /dev/null
+++ b/llvm/test/Assembler/mdlocation.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1, !1, !2, !2, !3, !3}
+!named = !{!0, !1, !2, !3, !4, !5, !6}
+
+; CHECK: !0 = !{}
+!0 = !{}
+
+; CHECK-NEXT: !1 = !MDLocation(line: 3, column: 7, scope: !0)
+!1 = !MDLocation(line: 3, column: 7, scope: !0)
+!2 = !MDLocation(scope: !0, column: 7, line: 3)
+
+; CHECK-NEXT: !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
+!3 = !MDLocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
+!4 = !MDLocation(column: 7, line: 3, scope: !0, inlinedAt: !1)
+
+; CHECK-NEXT: !3 = !MDLocation(scope: !0)
+!5 = !MDLocation(scope: !0)
+!6 = !MDLocation(scope: !0, column: 0, line: 0)
OpenPOWER on IntegriCloud