Adding a CHECK to test case.

Hi,

clang_inline_opt.swift test case is failing on ppc64le with following error:

/root/swift-source/swift/test/IRGen/clang_inline_opt.swift:10:11: error:
expected string not found in input
// CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {
          ^
<stdin>:1:1: note: scanning from here
; ModuleID = '-'
^
<stdin>:34:1: note: possible intended match here
define internal zeroext i32 @return7() #1 {
^

On ppc64le, following change is required to the CHECK string:
// CHECK: define internal zeroext i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {

The original string is:
// CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {

How do I add a new CHECK to this file? I tried using CHECK-powerpc64le but
that doesn't work.

Second alternative is to disable this test on ppc64le. For this I tried to
introduce following 2 lines to the clang_inline_opt.swift file by looking
at other similar files:
// REQUIRES: CPU=i386 || CPU=x86_64
// XFAIL: Linux

But this too is not working, How do I make this test skip on ppc64le
otherwise?

Thanks,
Atul.

Hi,

clang_inline_opt.swift test case is failing on ppc64le with following error:

/root/swift-source/swift/test/IRGen/clang_inline_opt.swift:10:11: error: expected string not found in input
// CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {
          ^
<stdin>:1:1: note: scanning from here
; ModuleID = '-'
^
<stdin>:34:1: note: possible intended match here
define internal zeroext i32 @return7() #1 {
^

On ppc64le, following change is required to the CHECK string:
// CHECK: define internal zeroext i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {

The original string is:
// CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {

How do I add a new CHECK to this file? I tried using CHECK-powerpc64le but that doesn't work.

Using an architecture-specific CHECK directive such as CHECK-powerpc64le requires additional changes to the RUN line. The CHECK variations need to be explained to FileCheck using the --check-prefix option.

Look at tests IRGen/c_layout.sil or IRGen/condfail.sil for examples.

Another possibility for this particular case is to allow `zeroext` on all platforms, on the assumption that the presence or absence of zeroext isn't what the test really wants to check. You could use a FileCheck regex to do that. Then you don't need the complication of an architecture-specific CHECK line. Try this:
    // CHECK: define internal{{( zeroext)?}} i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {

Second alternative is to disable this test on ppc64le. For this I tried to introduce following 2 lines to the clang_inline_opt.swift file by looking at other similar files:
// REQUIRES: CPU=i386 || CPU=x86_64
// XFAIL: Linux

But this too is not working, How do I make this test skip on ppc64le otherwise?

The simple way to disable the test on ppc64le is probably spelled like this:
    // UNSUPPORTED: CPU=powerpc64le
But making the test work for ppc64le is generally preferred.

···

On Dec 13, 2017, at 10:47 PM, Atul Sowani via swift-dev <swift-dev@swift.org> wrote:

--
Greg Parker gparker@apple.com Runtime Wrangler

Excellent help Greg! Thank you so much for this! Really appreciate it.

Atul.

···

On Tue, Dec 19, 2017 at 6:30 AM, Greg Parker <gparker@apple.com> wrote:

> On Dec 13, 2017, at 10:47 PM, Atul Sowani via swift-dev < > swift-dev@swift.org> wrote:
>
> Hi,
>
> clang_inline_opt.swift test case is failing on ppc64le with following
error:
>
> /root/swift-source/swift/test/IRGen/clang_inline_opt.swift:10:11:
error: expected string not found in input
> // CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {
> ^
> <stdin>:1:1: note: scanning from here
> ; ModuleID = '-'
> ^
> <stdin>:34:1: note: possible intended match here
> define internal zeroext i32 @return7() #1 {
> ^
>
> On ppc64le, following change is required to the CHECK string:
> // CHECK: define internal zeroext i32 @return7() [[CLANG_ATTRS:#[0-9]+]]
{
>
> The original string is:
> // CHECK: define internal i32 @return7() [[CLANG_ATTRS:#[0-9]+]] {
>
> How do I add a new CHECK to this file? I tried using CHECK-powerpc64le
but that doesn't work.

Using an architecture-specific CHECK directive such as CHECK-powerpc64le
requires additional changes to the RUN line. The CHECK variations need to
be explained to FileCheck using the --check-prefix option.

Look at tests IRGen/c_layout.sil or IRGen/condfail.sil for examples.

Another possibility for this particular case is to allow `zeroext` on all
platforms, on the assumption that the presence or absence of zeroext isn't
what the test really wants to check. You could use a FileCheck regex to do
that. Then you don't need the complication of an architecture-specific
CHECK line. Try this:
    // CHECK: define internal{{( zeroext)?}} i32 @return7()
[[CLANG_ATTRS:#[0-9]+]] {

> Second alternative is to disable this test on ppc64le. For this I tried
to introduce following 2 lines to the clang_inline_opt.swift file by
looking at other similar files:
> // REQUIRES: CPU=i386 || CPU=x86_64
> // XFAIL: Linux
>
> But this too is not working, How do I make this test skip on ppc64le
otherwise?

The simple way to disable the test on ppc64le is probably spelled like
this:
    // UNSUPPORTED: CPU=powerpc64le
But making the test work for ppc64le is generally preferred.

--
Greg Parker gparker@apple.com Runtime Wrangler

I'm excited that you're picking up the work on getting Swift working well on PowerPC64LE, but please don't reply to old threads with unrelated topics.