summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2014-05-02 09:33:30 +0000
committerRobert Lytton <robert@xmos.com>2014-05-02 09:33:30 +0000
commitf80d68847dcf2a5923eb1e7acfc50c290fdc8f79 (patch)
tree409ffa36619def5a60c5bdaf61676cf3fabe93a5 /clang/test/CodeGen
parent894d25c1e026c830b6d2211255f785e5da2dceaa (diff)
downloadbcm5719-llvm-f80d68847dcf2a5923eb1e7acfc50c290fdc8f79.tar.gz
bcm5719-llvm-f80d68847dcf2a5923eb1e7acfc50c290fdc8f79.zip
XCore target: fix bug in dereferencing null pointer.
Also add basic cpp ABI tests where they differ from C ABI output. llvm-svn: 207834
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/xcore-abi.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CodeGen/xcore-abi.cpp b/clang/test/CodeGen/xcore-abi.cpp
new file mode 100644
index 00000000000..fbf31ff50aa
--- /dev/null
+++ b/clang/test/CodeGen/xcore-abi.cpp
@@ -0,0 +1,27 @@
+// REQUIRES: xcore-registered-target
+
+// RUN: %clang_cc1 -triple xcore-unknown-unknown -fno-signed-char -fno-common -emit-llvm -o - -x c++ %s | FileCheck %s
+
+// CHECK: target triple = "xcore-unknown-unknown"
+
+
+// C++ constants are not placed into the ".cp.rodata" section.
+// CHECK: @cgx = external constant i32
+extern const int cgx;
+int fcgx() { return cgx;}
+// CHECK: @g1 = global i32 0, align 4
+int g1;
+// CHECK: @cg1 = constant i32 0, align 4
+extern const int cg1 = 0;
+
+// Regression test for a bug in lib/CodeGen/CodeGenModule.cpp which called
+// getLanguageLinkage() via a null 'VarDecl*'. This was an XCore specific
+// conditional call to GV->setSection(".cp.rodata").
+class C {
+public:
+ ~C(){};
+};
+C c;
+
+// CHECK: "no-frame-pointer-elim"="false"
+// CHECK-NOT: "no-frame-pointer-elim-non-leaf"
OpenPOWER on IntegriCloud