summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-08-21 13:58:40 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-08-21 13:58:40 +0000
commita96344b50d09e299184772ccd06f9b30c0022f65 (patch)
tree93ab76957283f0c5b8ff174ccabd5f15200e06ee /clang/test/Sema
parent9affba4f9d7ac754565c9f5ab5da9bceaa506d5e (diff)
downloadbcm5719-llvm-a96344b50d09e299184772ccd06f9b30c0022f65.tar.gz
bcm5719-llvm-a96344b50d09e299184772ccd06f9b30c0022f65.zip
R600: Implement getPointerWidthV()
This fixes a crash in the OCL_ImgProc/Canny OpenCV test. NOTE: This is a candidate for the 3.5 branch. llvm-svn: 216181
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/sizeof-struct-non-zero-as-member.cl18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Sema/sizeof-struct-non-zero-as-member.cl b/clang/test/Sema/sizeof-struct-non-zero-as-member.cl
new file mode 100644
index 00000000000..b64c03619ca
--- /dev/null
+++ b/clang/test/Sema/sizeof-struct-non-zero-as-member.cl
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -triple r600 -target-cpu verde -S -emit-llvm -o - %s
+// expected-no-diagnostics
+
+// Record lowering was crashing on SI and newer targets, because it
+// was using the wrong size for test::ptr. Since global memory
+// has 64-bit pointers, sizeof(test::ptr) should be 8.
+
+struct test_as0 {int *ptr;};
+constant int as0[sizeof(struct test_as0) == 4 ? 1 : -1] = { 0 };
+
+struct test_as1 {global int *ptr;};
+constant int as1[sizeof(struct test_as1) == 8 ? 1 : -1] = { 0 };
+
+struct test_as2 {constant int *ptr;};
+constant int as2[sizeof(struct test_as2) == 8 ? 1 : -1] = { 0 };
+
+struct test_as3 {local int *ptr;};
+constant int as3[sizeof(struct test_as3) == 4 ? 1 : -1] = { 0 };
OpenPOWER on IntegriCloud