[PATCH] D130255: [Clang][LoongArch] Add initial LoongArch target and driver support

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 19:32:23 PDT 2022


MaskRay added inline comments.


================
Comment at: clang/lib/Basic/Targets/LoongArch.cpp:26
+  // TODO: To be implemented in future.
+  return ArrayRef<const char *>();
+}
----------------
`return {}`


================
Comment at: clang/test/Driver/frame-pointer.c:60
 
+// RUN: %clang -target loongarch32 -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target loongarch32 -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
----------------
Use `--target=` for new tests. `-target ` is a legacy syntax.


================
Comment at: clang/test/Driver/frame-pointer.c:71
+// RUN: %clang -target loongarch64 -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
+//
 // CHECK0-32: -mframe-pointer=all
----------------
remove `//` from the otherwise empty line


================
Comment at: clang/test/Driver/loongarch-abi-error.c:1
+// RUN: not %clang --target=loongarch32-unknown-elf %s -o %t.o -mabi=lp64s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-LA32-LP64S %s
----------------
-fsyntax and remove `-o %t.o`


================
Comment at: clang/test/Driver/loongarch-abi.c:1
+// RUN: %clang --target=loongarch32-unknown-elf %s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-ILP32D %s
----------------
The line isn't very song, no need to break it into two.


================
Comment at: clang/test/Preprocessor/init-loongarch.c:1
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=loongarch32 < /dev/null \
+// RUN:   | FileCheck --match-full-lines --check-prefix=LA32 %s
----------------
remove `< `


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130255



More information about the cfe-commits mailing list