summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/NVPTX/global-ctor.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/NVPTX/global-ctor.ll')
-rw-r--r--llvm/test/CodeGen/NVPTX/global-ctor.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/global-ctor.ll b/llvm/test/CodeGen/NVPTX/global-ctor.ll
new file mode 100644
index 00000000000..89155db08ea
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/global-ctor.ll
@@ -0,0 +1,9 @@
+; RUN: not llc < %s -march=nvptx -mcpu=sm_20 2>&1 | FileCheck %s
+
+; Check that llc dies when given a nonempty global ctor.
+@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo, i8* null }]
+
+; CHECK: ERROR: Module has a nontrivial global ctor
+define internal void @foo() {
+ ret void
+}
OpenPOWER on IntegriCloud