summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/apple-kext-guard-variable.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-18 02:56:14 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-18 02:56:14 +0000
commit7ef5cb3038fcbd4caa102d1ce9d70ae598985a7c (patch)
treecf12fb2284f5fc7e93e2cf14b6d186631d0cdad2 /clang/test/CodeGenCXX/apple-kext-guard-variable.cpp
parent7c9cc461651e1acb8c1c9c19141d8477c86c6976 (diff)
downloadbcm5719-llvm-7ef5cb3038fcbd4caa102d1ce9d70ae598985a7c.tar.gz
bcm5719-llvm-7ef5cb3038fcbd4caa102d1ce9d70ae598985a7c.zip
The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error; it's not really worthwhile doing this "right", i.e. in Sema, because IR gen knows a lot of tricks beyond what the constant evaluator knows. llvm-svn: 127854
Diffstat (limited to 'clang/test/CodeGenCXX/apple-kext-guard-variable.cpp')
-rw-r--r--clang/test/CodeGenCXX/apple-kext-guard-variable.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/apple-kext-guard-variable.cpp b/clang/test/CodeGenCXX/apple-kext-guard-variable.cpp
new file mode 100644
index 00000000000..f9d44603a84
--- /dev/null
+++ b/clang/test/CodeGenCXX/apple-kext-guard-variable.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang -mtriple=x86_64-apple-darwin10 -S -mkernel -Xclang -verify %s
+
+// rdar://problem/9143356
+
+int foo();
+void test() {
+ static int y = 0;
+ static int x = foo(); // expected-error {{this initialization requires a guard variable, which the kernel does not support}}
+}
OpenPOWER on IntegriCloud