brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 6efd859 Raw
28 lines · cpp
1/// Test passing args to plugins via the clang driver and -fplugin-arg2// RUN: %clang -fplugin=%llvmshlibdir/CallSuperAttr%pluginext -fplugin-arg-call_super_plugin-help -fsyntax-only -### %s 2>&1 | FileCheck %s3 4// CHECK: "-load"5// CHECK-SAME: CallSuperAttr6// CHECK-SAME: "-plugin-arg-call_super_plugin"7// CHECK-SAME: "help"8 9/// Check that dashed-args get forwarded like this to the plugin.10/// Dashes cannot be part of the plugin name here11// RUN: %clang -fplugin=%llvmshlibdir/CallSuperAttr%pluginext -fplugin-arg-call_super_plugin-help-long -fsyntax-only %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CMD12// CHECK-CMD: "-plugin-arg-call_super_plugin" "help-long"13 14/// Error handling for -fplugin-arg-15// RUN: %clang -fplugin=%llvmshlibdir/CallSuperAttr%pluginext -fplugin-arg- -fsyntax-only %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PLUGIN-NAME16// CHECK-NO-PLUGIN-NAME: missing plugin name in -fplugin-arg-17 18// RUN: %clang -fplugin=%llvmshlibdir/CallSuperAttr%pluginext -fplugin-arg-testname -fsyntax-only %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PLUGIN-ARG119// CHECK-NO-PLUGIN-ARG1: missing plugin argument for plugin testname in -fplugin-arg-testname20 21// RUN: %clang -fplugin=%llvmshlibdir/CallSuperAttr%pluginext -fplugin-arg-testname- -fsyntax-only %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PLUGIN-ARG222// CHECK-NO-PLUGIN-ARG2: missing plugin argument for plugin testname in -fplugin-arg-testname-23 24// Plugins are only relevant for the -cc1 phase. No warning should be raised25// when only using the assembler. See GH #88173.26// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option -Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PLUGIN-ASM27// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: '-f{{[a-z-]*plugin[^']*}}'28