summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/builtin-constant-p.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-11-30 21:26:09 +0000
committerFangrui Song <maskray@google.com>2018-11-30 21:26:09 +0000
commitf5d3335d75dfe13b1263bbc305514ccfbc25417d (patch)
tree109c58b9f8af11bcec6b2b974867c9f7d07729af /clang/test/CodeGenCXX/builtin-constant-p.cpp
parentd1a4b06c208c177a4a86c4c8ec994ca4fd44870e (diff)
downloadbcm5719-llvm-f5d3335d75dfe13b1263bbc305514ccfbc25417d.tar.gz
bcm5719-llvm-f5d3335d75dfe13b1263bbc305514ccfbc25417d.zip
Revert r347417 "Re-Reinstate 347294 with a fix for the failures."
Kept the "indirect_builtin_constant_p" test case in test/SemaCXX/constant-expression-cxx1y.cpp while we are investigating why the following snippet fails: extern char extern_var; struct { int a; } a = {__builtin_constant_p(extern_var)}; llvm-svn: 348039
Diffstat (limited to 'clang/test/CodeGenCXX/builtin-constant-p.cpp')
-rw-r--r--clang/test/CodeGenCXX/builtin-constant-p.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/clang/test/CodeGenCXX/builtin-constant-p.cpp b/clang/test/CodeGenCXX/builtin-constant-p.cpp
deleted file mode 100644
index 6d853e8a682..00000000000
--- a/clang/test/CodeGenCXX/builtin-constant-p.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -o - %s
-
-// Don't crash if the argument to __builtin_constant_p isn't scalar.
-template <typename T>
-constexpr bool is_constant(const T v) {
- return __builtin_constant_p(v);
-}
-
-template <typename T>
-class numeric {
- public:
- using type = T;
-
- template <typename S>
- constexpr numeric(S value)
- : value_(static_cast<T>(value)) {}
-
- private:
- const T value_;
-};
-
-bool bcp() {
- return is_constant(numeric<int>(1));
-}
OpenPOWER on IntegriCloud