[PATCH] D94854: [Clang] Fix SwiftCallingConv's aggregate lowering for _Atomic(_Bool).

Varun Gandhi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 15 18:57:07 PST 2021


varungandhi-apple added a comment.

I don't know how to test this on the LLVM-side (is there a way to do it?). Here's the Swift side test which trips over right now (but is fixed with this patch) by attempting a zext from an i8 to an i1 in Swift's `NativeConventionSchema::mapIntoNative`.

  +++ b/test/IRGen/Inputs/atomic_bool.h
  @@ -0,0 +1 @@
  +typedef struct { _Atomic(_Bool) value; } MyAtomicBool;
  +++ b/test/IRGen/Inputs/module.modulemap
  @@ -23 +23,6 @@ module AutolinkModuleMapLink {
   }
  +
  +module AtomicBoolModule {
  +  header "atomic_bool.h"
  +  export *
  +}
  +++ b/test/IRGen/atomic_bool.swift
  @@ -0,0 +1,7 @@
  +// RUN: not --crash %target-swift-emit-ir %s -I %S/Inputs
  +
  +import AtomicBoolModule
  +
  +public func f() -> MyAtomicBool {
  +  return MyAtomicBool()
  +}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94854/new/

https://reviews.llvm.org/D94854



More information about the cfe-commits mailing list