================
@@ -0,0 +1,16 @@
+// REQUIRES: host-supports-jit
+//
+// '#pragma clang repl optimize(N)' sets the optimization level used to emit
+// subsequent input: 'optnone' is present at -O0 and gone once the level is
+// raised.
+//
+// RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -emit-llvm | FileCheck %s
+
+extern "C" int f_optnone() { return 0; }
+// CHECK: Function Attrs:{{.*}} optnone
+// CHECK-NEXT: define {{.*}} @f_optnone()
+
+#pragma clang repl optimize(2)
+extern "C" int f_optimized() { return 1; }
+// CHECK: define {{.*}} @f_optimized()
+// CHECK-NOT: optnone
----------------
aaronj0 wrote:Makes sense, is the current test better? https://github.com/llvm/llvm-project/pull/214793 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
