1*713a2029SKyungwoo Lee // Verify only one of codegen-data flag is passed. 2*713a2029SKyungwoo Lee // RUN: not %clang -### -S --target=aarch64-linux-gnu -fcodegen-data-generate -fcodegen-data-use %s 2>&1 | FileCheck %s --check-prefix=CONFLICT 3*713a2029SKyungwoo Lee // RUN: not %clang -### -S --target=arm64-apple-darwin -fcodegen-data-generate -fcodegen-data-use %s 2>&1 | FileCheck %s --check-prefix=CONFLICT 4*713a2029SKyungwoo Lee // CONFLICT: error: invalid argument '-fcodegen-data-generate' not allowed with '-fcodegen-data-use' 5*713a2029SKyungwoo Lee 6*713a2029SKyungwoo Lee // Verify the codegen-data-generate (boolean) flag is passed to LLVM 7*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=aarch64-linux-gnu -fcodegen-data-generate %s 2>&1| FileCheck %s --check-prefix=GENERATE 8*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=arm64-apple-darwin -fcodegen-data-generate %s 2>&1| FileCheck %s --check-prefix=GENERATE 9*713a2029SKyungwoo Lee // GENERATE: "-mllvm" "-codegen-data-generate" 10*713a2029SKyungwoo Lee 11*713a2029SKyungwoo Lee // Verify the codegen-data-use-path flag (with a default value) is passed to LLVM. 12*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=aarch64-linux-gnu -fcodegen-data-use %s 2>&1| FileCheck %s --check-prefix=USE 13*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=arm64-apple-darwin -fcodegen-data-use %s 2>&1| FileCheck %s --check-prefix=USE 14*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=aarch64-linux-gnu -fcodegen-data-use=file %s 2>&1 | FileCheck %s --check-prefix=USE-FILE 15*713a2029SKyungwoo Lee // RUN: %clang -### -S --target=arm64-apple-darwin -fcodegen-data-use=file %s 2>&1 | FileCheck %s --check-prefix=USE-FILE 16*713a2029SKyungwoo Lee // USE: "-mllvm" "-codegen-data-use-path=default.cgdata" 17*713a2029SKyungwoo Lee // USE-FILE: "-mllvm" "-codegen-data-use-path=file" 18*713a2029SKyungwoo Lee 19*713a2029SKyungwoo Lee // Verify the codegen-data-generate (boolean) flag with a LTO. 20*713a2029SKyungwoo Lee // RUN: %clang -### -flto --target=aarch64-linux-gnu -fcodegen-data-generate %s 2>&1 | FileCheck %s --check-prefix=GENERATE-LTO 21*713a2029SKyungwoo Lee // GENERATE-LTO: {{ld(.exe)?"}} 22*713a2029SKyungwoo Lee // GENERATE-LTO-SAME: "-plugin-opt=-codegen-data-generate" 23*713a2029SKyungwoo Lee // RUN: %clang -### -flto --target=arm64-apple-darwin -fcodegen-data-generate %s 2>&1 | FileCheck %s --check-prefix=GENERATE-LTO-DARWIN 24*713a2029SKyungwoo Lee // GENERATE-LTO-DARWIN: {{ld(.exe)?"}} 25*713a2029SKyungwoo Lee // GENERATE-LTO-DARWIN-SAME: "-mllvm" "-codegen-data-generate" 26*713a2029SKyungwoo Lee 27*713a2029SKyungwoo Lee // Verify the codegen-data-use-path flag with a LTO is passed to LLVM. 28*713a2029SKyungwoo Lee // RUN: %clang -### -flto=thin --target=aarch64-linux-gnu -fcodegen-data-use %s 2>&1 | FileCheck %s --check-prefix=USE-LTO 29*713a2029SKyungwoo Lee // USE-LTO: {{ld(.exe)?"}} 30*713a2029SKyungwoo Lee // USE-LTO-SAME: "-plugin-opt=-codegen-data-use-path=default.cgdata" 31*713a2029SKyungwoo Lee // RUN: %clang -### -flto=thin --target=arm64-apple-darwin -fcodegen-data-use %s 2>&1 | FileCheck %s --check-prefix=USE-LTO-DARWIN 32*713a2029SKyungwoo Lee // USE-LTO-DARWIN: {{ld(.exe)?"}} 33*713a2029SKyungwoo Lee // USE-LTO-DARWIN-SAME: "-mllvm" "-codegen-data-use-path=default.cgdata" 34*713a2029SKyungwoo Lee 35*713a2029SKyungwoo Lee // For now, LLD MachO supports for generating the codegen data at link time. 36*713a2029SKyungwoo Lee // RUN: %clang -### -fuse-ld=lld -B%S/Inputs/lld --target=arm64-apple-darwin -fcodegen-data-generate %s 2>&1 | FileCheck %s --check-prefix=GENERATE-LLD-DARWIN 37*713a2029SKyungwoo Lee // GENERATE-LLD-DARWIN: {{ld(.exe)?"}} 38*713a2029SKyungwoo Lee // GENERATE-LLD-DARWIN-SAME: "--codegen-data-generate-path=default.cgdata" 39