[clang] [test] Add a (xfailing) test for PR41027
authorMichal Gorny <mgorny@gentoo.org>
Wed, 5 Jun 2019 08:21:42 +0000 (08:21 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 5 Jun 2019 08:21:42 +0000 (08:21 +0000)
Add a test for tracking PR41027 (8.0 regression breaking assembly code
relying on __builtin_constant_p() to identify compile-time constants).
Mark it as expected to fail everywhere.

Differential Revision: https://reviews.llvm.org/D60728

llvm-svn: 362587

clang/test/Sema/pr41027.c [new file with mode: 0644]

diff --git a/clang/test/Sema/pr41027.c b/clang/test/Sema/pr41027.c
new file mode 100644 (file)
index 0000000..94ace64
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple x86_64 -fsyntax-only %s
+// XFAIL: *
+
+inline void pr41027(unsigned a, unsigned b) {
+  if (__builtin_constant_p(a)) {
+    __asm__ volatile("outl %0,%w1" : : "a"(b), "n"(a));
+  } else {
+    __asm__ volatile("outl %0,%w1" : : "a"(b), "d"(a));
+  }
+}