summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/bitfield.c
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-08-21 20:58:45 +0000
committerManman Ren <manman.ren@gmail.com>2013-08-21 20:58:45 +0000
commit879ce8841dc980104d1e99bd45ad6f15bb4efd2e (patch)
tree22f08ab9016385141039621e2642ac560ffd1c78 /clang/test/CodeGen/bitfield.c
parent3380ee5e60c93c5bc8a9d6adc94cb84eb08cce46 (diff)
downloadbcm5719-llvm-879ce8841dc980104d1e99bd45ad6f15bb4efd2e.tar.gz
bcm5719-llvm-879ce8841dc980104d1e99bd45ad6f15bb4efd2e.zip
Don't use mangleCXXRTTIName in TBAA for C code.
With r185721, calling mangleCXXRTTIName on C code will cause crashes. This commit fixes crashes on C testing cases when turning on struct-path TBAA. For C code, we simply use the Decl name without the context. This can cause two different structs having the same name, and may cause inaccurate but conservative alias results. llvm-svn: 188930
Diffstat (limited to 'clang/test/CodeGen/bitfield.c')
-rw-r--r--clang/test/CodeGen/bitfield.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/bitfield.c b/clang/test/CodeGen/bitfield.c
index 03748a067b1..41befe7c176 100644
--- a/clang/test/CodeGen/bitfield.c
+++ b/clang/test/CodeGen/bitfield.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - -O3 | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - -O3 -struct-path-tbaa | FileCheck %s --check-prefix=PATH
static int f0(int n) {
struct s0 {
@@ -17,6 +18,8 @@ static int f0(int n) {
int g0(void) {
// CHECK-LABEL: @g0()
// CHECK: ret i32 1
+// PATH-LABEL: @g0()
+// PATH: ret i32 1
return f0(-1) + 44335655;
}
@@ -37,6 +40,8 @@ static int f1(void) {
int g1(void) {
// CHECK-LABEL: @g1()
// CHECK: ret i32 1
+// PATH-LABEL: @g1()
+// PATH: ret i32 1
return f1() + 16;
}
@@ -55,6 +60,8 @@ static int f2(void) {
int g2(void) {
// CHECK-LABEL: @g2()
// CHECK: ret i32 1
+// PATH-LABEL: @g2()
+// PATH: ret i32 1
return f2() - 9;
}
@@ -76,5 +83,7 @@ static int f3(int n) {
int g3(void) {
// CHECK-LABEL: @g3()
// CHECK: ret i32 1
+// PATH-LABEL: @g3()
+// PATH: ret i32 1
return f3(20) + 130725747;
}
OpenPOWER on IntegriCloud